DataTable column width

DataTable column width

Gabriel23Gabriel23 Posts: 33Questions: 8Answers: 0

I am trying to change the width of a particular column , specifically I want to make it smaller , but there is no way I can change the size of the column in a smaller one, only higher.
The first way I tried was using columnDefs
"columnDefs": [
{ "width": "50px", "targets": 0 }
],
and the second way
"columns": [
{ "data": "Id", "name": "Id", "autowidth": false , width : '50px' }]
both not working for setting column width smaller.
Table has a fixed width, also header contains 2 buttons but they have enough space , or at least that's what I am seeing . The column width won't go less then 168px no matter what , any advice?

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Gabriel23 ,

    This thread should help, it's asking the same thing.

    Cheers,

    Colin

  • Gabriel23Gabriel23 Posts: 33Questions: 8Answers: 0

    I do not want to add that lines in css cause it will result in a total mess in my table

  • Gabriel23Gabriel23 Posts: 33Questions: 8Answers: 0

    I figured out , I had an input of type text which had a default size so I changed it's size before adjusting entire table width and not it works as expected

This discussion has been closed.