can i mix different types of sWidth (like px and %) ?
can i mix different types of sWidth (like px and %) ?
i want to have some columns with fixed width, and the rest of them to divide the free space in %
[code]
{ "sName": "ragsoc_denom", "sWidth": "50%"},
{ "sName": "piva", "sWidth": "80px"},
{ "sName": "telefono", "sWidth": "25%"},
{ "sName": "indirizzo", "sWidth": "25%"},
{ "sName": "cap", "sWidth": "50px"},
{ "sName": "citta", "sWidth": "50px"},
{ "sName": "id", "sWidth": "70px"};
[/code]
however the columns with PX width, get a width less than the one specified resulting in the ordering icon arrows under the text and ugly formattation
[code]
{ "sName": "ragsoc_denom", "sWidth": "50%"},
{ "sName": "piva", "sWidth": "80px"},
{ "sName": "telefono", "sWidth": "25%"},
{ "sName": "indirizzo", "sWidth": "25%"},
{ "sName": "cap", "sWidth": "50px"},
{ "sName": "citta", "sWidth": "50px"},
{ "sName": "id", "sWidth": "70px"};
[/code]
however the columns with PX width, get a width less than the one specified resulting in the ordering icon arrows under the text and ugly formattation
This discussion has been closed.
Replies
Also one thing worth noting is that DataTables will convert your % values to pixels when the draw occurs (it will build a "worst case" table and apply your sizing, then read back the pixel values calculated, so that the table doesn't jump around all over the place when paging.
Allan
[code]
var free_space = ($('#table').width() - $('#fixed_width_th_cell').width());
$('#percentual_width_cell_th').width(free_space/3);
[/code]
and where should i run it in ? fnDrawCallback?
i noticed that if i only specify the pixel sWidth and don't specify the percentual sWidth, the % td split the space evenly beetween them but i can't decide how much of it