mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Only visible columns will be considered when fixing column widths. Fixes #371
This commit is contained in:
parent
4bcf3b9003
commit
636ef9c65a
@ -497,7 +497,8 @@
|
|||||||
if (table.config.widthFixed && $(table).find('colgroup').length === 0) {
|
if (table.config.widthFixed && $(table).find('colgroup').length === 0) {
|
||||||
var colgroup = $('<colgroup>'),
|
var colgroup = $('<colgroup>'),
|
||||||
overallWidth = $(table).width();
|
overallWidth = $(table).width();
|
||||||
$(table.tBodies[0]).find("tr:first").children("td").each(function() {
|
// only add col for visible columns - fixes #371
|
||||||
|
$(table.tBodies[0]).find("tr:first").children("td:visible").each(function() {
|
||||||
colgroup.append($('<col>').css('width', parseInt(($(this).width()/overallWidth)*1000, 10)/10 + '%'));
|
colgroup.append($('<col>').css('width', parseInt(($(this).width()/overallWidth)*1000, 10)/10 + '%'));
|
||||||
});
|
});
|
||||||
$(table).prepend(colgroup);
|
$(table).prepend(colgroup);
|
||||||
|
Loading…
Reference in New Issue
Block a user