Set column width for specific columns.
Set column width for specific columns.
Glyndwr
Posts: 128Questions: 35Answers: 1
I am trying to set the width of a column. I have reviewed: https://datatables.net/reference/option/columns.width and then created this code: http://live.datatables.net/tipupiba/1/edit which is not setting the column width.
Kind regards,
Glyn
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Your example is giving this error in the browser's console.
The reason is you are using
columns.data
but have defined it for only one column. Changing the example to usecolumnDefs
andcolumnDefs.targets
removes the error and the Datatable now loads correctly.http://live.datatables.net/caciqeti/1
Kevin
Hi Kevin,
Thank you very much for your help. Unfortunately the column width is still not being set.
Kind regards,
Glyn
Looks like the column width is being set.
Try clicking the upward right arrow at the top of the
Output
tab.Kevin
Hi Kevin,
Thanks for that. This works. I now have a more complex issue that I will create a new sample and post for.
Kind regards,
Glyn