I am still stuck up in this problem. I want to create dynamically multiple tables from a single table based on column divider. Let's say, I have 11 columns in a table and the divider is 3. So, there will be three tables with three columns and the fourth table will have two columns. I also want to repeat the header in each table. Here is sample HTML table.
<table class="PrintTable">
<tr>
<td>
<table>
<thead>
<tr><th>Type Of Transaction</th></tr>
</thead>
<tbody>
<tr>
<td>Name</td>
</tr>
<tr>
<td>Age</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2006</th></tr>
</thead>
<tbody>
<tr>
<td>Andi</td>
</tr>
<tr>
<td>25</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2007</th></tr>
</thead>
<tbody>
<tr>
<td>tom</td>
</tr>
<tr>
<td>26</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2008</th></tr>
</thead>
<tbody>
<tr>
<td>Tiger</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2009</th></tr>
</thead>
<tbody>
<tr>
<td>Horse</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2011</th></tr>
</thead>
<tbody>
<tr>
<td>Twinkle</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2012</th></tr>
</thead>
<tbody>
<tr>
<td>Haris</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2013</th></tr>
</thead>
<tbody>
<tr>
<td>LEno</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2014</th></tr>
</thead>
<tbody>
<tr>
<td>Jay</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
Expected Output:-
<table class="PrintTable">
<tr>
<td>
<table>
<thead>
<tr><th>Type Of Transaction</th></tr>
</thead>
<tbody>
<tr>
<td>Name</td>
</tr>
<tr>
<td>Age</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2006</th></tr>
</thead>
<tbody>
<tr>
<td>Andi</td>
</tr>
<tr>
<td>25</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2007</th></tr>
</thead>
<tbody>
<tr>
<td>tom</td>
</tr>
<tr>
<td>26</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2008</th></tr>
</thead>
<tbody>
<tr>
<td>Tiger</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<table class="PrintTable">
<tr>
<td>
<table>
<thead>
<tr><th>Type Of Transaction</th></tr>
</thead>
<tbody>
<tr>
<td>Name</td>
</tr>
<tr>
<td>Age</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2009</th></tr>
</thead>
<tbody>
<tr>
<td>Horse</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2011</th></tr>
</thead>
<tbody>
<tr>
<td>Twinkle</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2012</th></tr>
</thead>
<tbody>
<tr>
<td>Haris</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<table class="PrintTable">
<tr>
<td>
<table>
<thead>
<tr><th>Type Of Transaction</th></tr>
</thead>
<tbody>
<tr>
<td>Name</td>
</tr>
<tr>
<td>Age</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2013</th></tr>
</thead>
<tbody>
<tr>
<td>LEno</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<thead>
<tr><th>2014</th></tr>
</thead>
<tbody>
<tr>
<td>Jay</td>
</tr>
<tr>
<td>28</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
Any help will be appreciated.
rowspanorcolspanin your original table?