X
xah
i'm just starting out on javascript.
can anyone show me how to go about writing a code to sort a table
column?
something like the following:
<table border="1">
<tr>
<td>
<a href="" onClick="">sort me</a>
</td>
<tr>
<tr>
<td>
2
</td>
<tr>
<tr>
<td>
3
</td>
<tr>
<tr>
<td>
1
</td>
<tr>
</table>
i'm guessing that the code would first read in the table entries as
documents.table.[1].??, assign it as a array, then sort, then delete
the table text, then print the table text.
How to delete the table text?
eventually this would be for a multi-column and multi-row table (a
matrix), and each row or column can be clicked to sort, without
disturbing existing order. The click would act as toggle or reverse
sorting.
Xah
(e-mail address removed)
∑ http://xahlee.org/
can anyone show me how to go about writing a code to sort a table
column?
something like the following:
<table border="1">
<tr>
<td>
<a href="" onClick="">sort me</a>
</td>
<tr>
<tr>
<td>
2
</td>
<tr>
<tr>
<td>
3
</td>
<tr>
<tr>
<td>
1
</td>
<tr>
</table>
i'm guessing that the code would first read in the table entries as
documents.table.[1].??, assign it as a array, then sort, then delete
the table text, then print the table text.
How to delete the table text?
eventually this would be for a multi-column and multi-row table (a
matrix), and each row or column can be clicked to sort, without
disturbing existing order. The click would act as toggle or reverse
sorting.
Xah
(e-mail address removed)
∑ http://xahlee.org/