surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.18k stars 808 forks source link

Matrix column header width #8897

Open rsantini62 opened 2 weeks ago

rsantini62 commented 2 weeks ago

Can I set the width for each column in a maxtrix column. It seems to work if I use matrixdropdown but not with matrix


var surveyJSON = {
      "logoPosition": "right",
      "pages": [
        {
          "name": "page1",
          "elements": [
            {
              "type": "matrixdropdown", //when I change this to type matrix the column width does not change
              "name": "question2",
              "titleLocation": "hidden",
              "hideNumber": true,

              columns: [
                { value: 1, name: "Strongly Disagree", width: "300px" },
                { value: 2, name: "Disagree", width: "120px" },
                { value: 3, name: "Neutral", width: "100px" },
                { value: 4, name: "Agree", width: "120px" },
                { value: 5, name: "Strongly Agree", width: "150px" }
              ],
              rows: [
                { value: "quality", text: "Product quality" },
                { value: "service", text: "Customer service" },
                { value: "recommend", text: "Would you recommend us?" }
              ],
              "isAllRowRequired": true
            }
          ]
        }
      ],

    };
JaneSjs commented 1 week ago

Hello @rsantini62, Would you share an illustration of the required output?

Thank you

rsantini62 commented 1 week ago

Thanks Jane. I have attached an illustration of what I am trying to achieve. I need to control the width of each individual column in a matrix. I can do it in a matrixdropdown. ColumnWidthMatrix

JaneSjs commented 4 days ago

Hello @rsantini62, Unfortunately, it is impossible to adjust widths of single-select matrix columns.

If you wish to achieve a specific matrix layout, please feel free to share your matrix definition and an illustration of the expected output. I'll be happy to assist you further.