I want to assign width to the datatable columns.. How to do that?

I want to assign width to the datatable columns.. How to do that?

laxmiparklaxmipark Posts: 22Questions: 8Answers: 0

I have tried with Columns as well as columnDefs .. it doesn't seem to be working.
I have 13 columns, do I have to specify the width for each of them?
"columnDefs": [
{ "orderDataType": "dom-input", "className": "dt-center", "targets": [9], "type": "string" },
{
"targets": [13],
"visible": false
},

                           { "width": "50px", "targets": 0 }
                    ],

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    columns.width is the way to assign width to a column. If that isn't working for you, please link to a page showing the issue so we can help debug it.

    Allan

  • laxmiparklaxmipark Posts: 22Questions: 8Answers: 0

    IT didn't work because I had autowidth: true at the start

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    That shouldn't stop columns.width being able to assign a width to certain columns. If you do have a link to the page showing the issue I can take a look.

    Thanks,
    Allan

This discussion has been closed.