MrRSMan
12-09-2007, 05:42 PM
My aim is to have a table, consisting of several columns and for the visitor to be able to reorder the contents of a table. My code example is below;
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="33%" align="center"><u><b>Name</b></u></td>
<td width="33%" align="center"><u><b>Age</b></u></td>
<td width="34%" align="center"><u><b>Date</b></u></td>
</tr>
<tr>
<td width="33%">John</td>
<td width="33%">48</td>
<td width="34%">13</td>
</tr>
<tr>
<td width="33%">George</td>
<td width="33%">52</td>
<td width="34%">6</td>
</tr>
<tr>
<td width="33%">Jack</td>
<td width="33%">39</td>
<td width="34%">22</td>
</tr>
</table>
So for example, if someone wanted to reorder the table according to "Date", they could just click a button to order the table according to ascending date, and another for descending, and the same for each other column.
I have seen this done using "id" and "alt" tags (I think), but I think this is PHP. Is there a way of doing this using HTML or JavaScript- or anything other than PHP or ASP? I am not using SQL.
Thank you, in advance :)
MrRSMan
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="33%" align="center"><u><b>Name</b></u></td>
<td width="33%" align="center"><u><b>Age</b></u></td>
<td width="34%" align="center"><u><b>Date</b></u></td>
</tr>
<tr>
<td width="33%">John</td>
<td width="33%">48</td>
<td width="34%">13</td>
</tr>
<tr>
<td width="33%">George</td>
<td width="33%">52</td>
<td width="34%">6</td>
</tr>
<tr>
<td width="33%">Jack</td>
<td width="33%">39</td>
<td width="34%">22</td>
</tr>
</table>
So for example, if someone wanted to reorder the table according to "Date", they could just click a button to order the table according to ascending date, and another for descending, and the same for each other column.
I have seen this done using "id" and "alt" tags (I think), but I think this is PHP. Is there a way of doing this using HTML or JavaScript- or anything other than PHP or ASP? I am not using SQL.
Thank you, in advance :)
MrRSMan