Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Try the below code to adjust the column width in data table

For the first column

$('#example').dataTable( {
  "columnDefs": [
    { "width": "20%", "targets": 0 }
  ]
} );

For more details check columns.width

For a specific column.

   $('#table_1').DataTable({
    columns: [
        { data: 'id', name: 'id' , width: '50px', class: 'text-right' }
    ]
    });

Ref: Setting column widthSetting column width

Try the below code to adjust the column width in data table

For the first column

$('#example').dataTable( {
  "columnDefs": [
    { "width": "20%", "targets": 0 }
  ]
} );

For more details check columns.width

For a specific column.

   $('#table_1').DataTable({
    columns: [
        { data: 'id', name: 'id' , width: '50px', class: 'text-right' }
    ]
    });

Ref: Setting column width

Try the below code to adjust the column width in data table

For the first column

$('#example').dataTable( {
  "columnDefs": [
    { "width": "20%", "targets": 0 }
  ]
} );

For more details check columns.width

For a specific column.

   $('#table_1').DataTable({
    columns: [
        { data: 'id', name: 'id' , width: '50px', class: 'text-right' }
    ]
    });

Ref: Setting column width

Source Link

Try the below code to adjust the column width in data table

For the first column

$('#example').dataTable( {
  "columnDefs": [
    { "width": "20%", "targets": 0 }
  ]
} );

For more details check columns.width

For a specific column.

   $('#table_1').DataTable({
    columns: [
        { data: 'id', name: 'id' , width: '50px', class: 'text-right' }
    ]
    });

Ref: Setting column width