This is kind of beyond my javascript/DOM knowledge and could use a help on this topic.
I’m using a third party software to populate a table (id=roster) contents that resides in a specified page that I need a script to work only for (other page use this table too but don’t need script to do it):
basic table structure come out something like this:
[CODE]
<body id=”pagebody”>
<table id=”roster”>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
continue to populate tds depend on how many fields are stored in db
<tr>
<th colspan=”7″></th>
</tr>
<tr>
<th colspan=”3″></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<th colspan=”3″></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<th colspan=”3″></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th colspan=”7″></th>
</tr>
</table>
</body>
Okay, now it comes to figure how the script should be written based on the process below:
1.
detect and remove (use removeChild) each last two of th and td from each tr that has seven th/td
modify tr’s attribute rowspan=7 to rowspan=5 due to the removal of ths and tds
remove each last two of th and td in each tr that has 5 th (one of them use rowspan=3).
Hope it explains clearly and appreciate any help in advance!
johnny