I am using jQuery-Visualize by Filament Group, Inc. which produces HTML5 canvas charts driven by HTML table elements.
A requirement of this plugin is, when using a multi-dimensional table, that the first th
in the thead
row tr
needs to be a td
.
My tables look like this:
<table>
<thead>
<tr>
<th>...</th> <!--This element-->
<th>...</th>
<th>...</th>
<th>...</th>
<th>...</th>
<th>...</th>
</tr>
</thead>
<tbody>
<tr>
<th>...</th>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
...
</tbody>
</table>
But the plugin requires this, otherwise it adds an extra empty classification to the graph, which changes the graph layout:
<table>
<thead>
<tr>
<td>...</td><!--Needs to be-->
<th>...</th>
<th>...</th>
<th>...</th>
<th>...</th>
<th>...</th>
</tr>
</thead>
<tbody>
<tr>
<th>...</th>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
...
</tbody>
</table>
I have an example on jsFiddle that demonstrates the issue.
How can I use Javascript/jQuery to change the table as described?