Generation

generate functionTue, 28 Feb 2023

calculate td tag width of table fixed layout in datatables

var table = $('#example').DataTable({ // columns and columnDefs }); table.columns().eq(0).each( function ( colIdx ) { var colWidth = table.column( colIdx ).width(); colIdx = colIdx + 1; $( '#example td:nth-child('+colIdx+')' ).css( 'width', colWidth ); });

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant