DoubleJ
06-20-2007, 04:59 PM
Eh I'm new to DOM concept and this issue's kind of beyond my knowledge, so hope somebody could lend a hand on it:
I'm using a fantasy football 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):
bascially the third party software populates the roster table structure something like this:
<body id="home">
<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 more tds depend on how many infomation 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>
Now I am not sure how the script should be written based on the process below, so the question is how should it be written?:
1. detect tr(s) that has 7 ths or tds and remove every last two of them from its' parent tr
2. modify th's attribute rowspan=7 to rowspan=5 due to the removal of ths and tds
3. detect tr(s) that has 5 ths where it hast a first-child th with rowspan=3 attribute and remove every last two of them from its' parent tr.
Appreicate any help in advance!
DoubleJ
I'm using a fantasy football 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):
bascially the third party software populates the roster table structure something like this:
<body id="home">
<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 more tds depend on how many infomation 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>
Now I am not sure how the script should be written based on the process below, so the question is how should it be written?:
1. detect tr(s) that has 7 ths or tds and remove every last two of them from its' parent tr
2. modify th's attribute rowspan=7 to rowspan=5 due to the removal of ths and tds
3. detect tr(s) that has 5 ths where it hast a first-child th with rowspan=3 attribute and remove every last two of them from its' parent tr.
Appreicate any help in advance!
DoubleJ