سؤال

I have a table and I want to resize the column of the table

$("#tableSortable").dataTable({
        "bAutoWidth": false,
        "aoColumns": [
        { sWidth: '1%' },
        { sWidth: '1%' },
        { sWidth: '1%' },
        { sWidth: '1%' } ]
    });
    tableSortable.fnDraw();
});
هل كانت مفيدة؟

المحلول

Well in comments Rory McCrossan mentioned . Yes the combined cells of table should be 100%

Well in your case there are 4 columns right then its pretty straight farword .

"aoColumns": [
        { sWidth: '25%' },
        { sWidth: '25%' },
        { sWidth: '25%' },
        { sWidth: '25%' } ]

And if you want to do it in a different way you can set bAutoWidth:True .

Regards

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top