Fixed Width Table and dataTables_wrapper!! Help!
Fixed Width Table and dataTables_wrapper!! Help!
I really need some help. I managed to get my table itself to be fixed width by using the !Important setting in my CSS, however, how can I control the width of the dataTables_wrapper?? It sets itself to 100% regardless, and I'd really like it to set itself to an appropriate width around the table, given that I have scrolling turned on. Any ideas?
This discussion has been closed.
Replies
[code]
// Compute the desired width. 500 is the minimum. Just in case we have a narrow table, we need room for the controls.
// The pagination stuff tends to be long, so we want to make sure we have enough room for that
var paginateWidth = 0;
$('div#mainTable_paginate').children().each(function() {
paginateWidth += $(this).width();
});
var width = Math.max(500, $('table#mainTable').width(), 2*paginateWidth);
$('div#mainDiv').width(width);
[/code]