RE: <table type="rowsortable">

An interesting idea, but needs to be considered with other things you might want to do with tabular data (e.g. reordering rows).  And " become re-ordered according to the data type of that column " is SUPER-vague.

-----Original Message-----
From: public-html-request@w3.org [mailto:public-html-request@w3.org] On Behalf Of Dailey, David P.
Sent: Wednesday, April 04, 2007 8:47 AM
To: Dailey, David P.; public-html@w3.org
Subject: <table type="rowsortable">


Story: Among the options for students to work on for final projects in an undergraduate interface design class, I often include a project to build a web browser out of JavaScript. It's a somewhat silly project, since one pretty much has to already have a web browser to interpret one's JavaScript. When students ask "why?", I explain that maybe they can make a better browser -- one which improves the pages they look at in some way. I leave it open to them as to what "improve" means, since this is a course in interface design... but as examples I give the ability to shift click on an HTML tag and see its source code, the ability to alt-click on words and look up their meanings, or the ability for tables to act like e-mail clients that translate a click on a column head and sort the rows according to the datatype associated with that particular column (we may sort alphabetically by "from" or "subject" or chronologically by "date"). I recall when I first saw IBM's Lotus Notes (which was the first place I saw column sorting in email) I thought -- "well of course." Now everybody does it.

Desired: <table type="rowSortable">
Description: Whenever a user clicks on the top (head) of a column, the rows of the associated tbody become re-ordered according to the data type of that column.
Example: http://srufaculty.sru.edu/david.dailey/javascript/tablesort.html (works in IE, FF and OP)

Use cases: in looking at the first few examples returned by a Google search on "table" that actually contain HTML tables,for example, http://www.w3.org/TR/html4/struct/tables.html and http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/table.asp
most seem to contain the kind of table that might benefit from allowing users to re-sort the data, ala the spreadsheet.

Specifically, when a table is used to actually present tabular data (like rows and columns of numbers, strings, dates, etc.), and has no rowspans or colspans, then the user's ability to interact with that data should be allowable by the author.

Legacy: Would anything old break by providing such new functionality? I don't know why it would, but I really don't know that it wouldn't.

Newfangled wheel?: Would this provide something that cannot already be done? Well, the above example indicates it can be done with a little bit of rather fragile script. If we insert extra whitespace in our example table, the code will break in Opera and FF. If we change from DOM2 methods to innerHTML it's break in FF because of the way style is handled... etc., etc. It could all be coded around, but the exercise, I would argue, is nontrivial.

David Dailey

Received on Wednesday, 4 April 2007 18:19:59 UTC