W3C home > Mailing lists > Public > public-html@w3.org > April 2007

Re: <table type="rowsortable">

From: Dao Gottwald <dao@design-noir.de>
Date: Wed, 04 Apr 2007 23:55:55 +0200
Message-ID: <46141EEB.7030901@design-noir.de>
To: "Dailey, David P." <david.dailey@sru.edu>
CC: public-html@w3.org

You might want to take a look at this proposal that I made for Firefox' 
directory listing:

https://bugzilla.mozilla.org/attachment.cgi?id=259884

It has sortable rows. The interesting parts are the "order" and 
"order-by" attributes for tables and the "sortable-data" attribute for 
table cells. I'd say something like that could be standardized.

Note that this was designed to work with Firefox trunk builds (Gecko 
1.9); all other browsers will probably get something wrong there.

--Dao

Dailey, David P. wrote:
> 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 21:55:59 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:42 UTC