I have a CGI script that generates an HTML table with an arbitrarily large number of rows, in an arbitrary order.
Each row is a member of one or more subsets, and there are 26 subsets total (26 representing a small relative constant).
While I am generating the page, I know which subsets each row belongs to, and can tag them in any way necessary.
I then wish to provide 26 buttons on the page with which the user can press any one of them to filter the table to that subset of rows. The order in which the rows appear is significant relative to each other, but no information is lost by hiding rows that do not belong to the subset the user desires to view.
The first priority is that the computations for the filtering are done client-side, not server-side, and the client does not re-request the page, as it is significant in size and the server is very busy doing other things. (read as: Javascript, right?) The page is not requested very often, but many filter operations are normally requested for each page request.
The second priority is that the client-side filtering is done as efficiently as possible. The dataset is very large.
The third priority is the widest possible browser interoperability.
I am not a web programmer by any stretch, if you can’t already tell.
I originally tried to do this by representing each tag as a CSS class, assigning multiple classes to each row as necessary, and then using JavaScript to modify the CSS definitions, but it started to give me a headache. If this works, I can’t quite figure it out.
CSS way, check it out – JSFiddle
And maybe someone could do something about ie6-7, if that matters.