Column width

Column width

plwplw Posts: 34Questions: 13Answers: 0

I have this

$(document).ready(function () {
$("#DTable").dataTable({
"pageLength": 30,
autoWidth: false,
columnDefs: [
{ type: 'natural-nohtml', targets: '0' },
{ width: '303px', targets: '2' }
],
"lengthMenu": [ 10, 25, 30, 50, 75, 100 ],
"bFilter": false,
"aaSorting": [[ 0, 'asc' ]],
"aoColumns": [
{ "bSortable": true },
{ "bSortable": true },
{ "bSortable": true },
{ "bSortable": false }
]
});
});

But whatever I do the width of the third column which should be 303px is being ignored. Any idea how I can set the width if the third column. The default isn't wide enough - thanks

Answers

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    Happy take a look at a test case showing the issue.

    Allan

  • plwplw Posts: 34Questions: 13Answers: 0
    edited October 2021

    It is ok - found the problem - there was an <h3> with a width as part of the table. I removed th ewidth and everything is now ok

Sign In or Register to comment.