I would like to split a “big” table (a lot of columns) to smaller tables every for example 2 columns.
Is there an easy way to do that?
I only have the table here http://jsfiddle.net/xy3UF/4/. And I would like for example split it every 2 columns. As a result I should have a three tables with containing the # column and each one containing 2 of the columns from the big table.
Desired output: http://jsfiddle.net/xy3UF/15/
Where
$tableis the table jQuery object, andchunkSizeis the size of each split. In your example, call it assplit($("table"), 2). Note thatchunkSizemust evenly divide the number of columns (excluding the first one) for this to work correctly, for example, for a table with 7 columns, the valid values forchunkSizeare 1, 2, and 3.DEMO.