I only wanted the first column to be fixed (unmovable), and this basically works. However if the first row is a title and has a different colSpan for the rest of the table it would duplicate the first column (in IE) or the first data column (Chrome\Firefox). That's a bug.
I had to repeatidly remove the duplicated column until it disappeared.
var cols = $("table").find("tr:nth-child(3) td");
var count = 0;
for(var i = 0; i < cols.length; i++)
{
var colspan = cols.eq(i).attr("colspan");
if( colspan && colspan > 1)
{
count += colspan;
}else{
count++;
}
}
for(var n = 0; n < count; n++)
{
$('td:nth-child(2), th:nth-child(2)', 'table:eq(1) tr').remove();
}
This feels like a bad hack and I would rather the script was improved for this kind of usage.
Thanks for such a useful script. I have a table with a dynamic number of columns, so using colModal isn't really practical.
If colModal isn't specified the code doesn't guard against this and will raise an exception in Chrome. I had to wrap the code like so:
And then:
I only wanted the first column to be fixed (unmovable), and this basically works. However if the first row is a title and has a different colSpan for the rest of the table it would duplicate the first column (in IE) or the first data column (Chrome\Firefox). That's a bug.
I had to repeatidly remove the duplicated column until it disappeared.
This feels like a bad hack and I would rather the script was improved for this kind of usage.