[whatwg] Feedback on a variety of elements

Pierre Dubois duboisp2 at gmail.com
Mon Dec 31 11:09:49 PST 2012

On Fri Dec 14 2012, Ian Hickson wrote:

> I don't think this works for all tables. For example, the first example in
> the spec in the <th> element's section does not get handled correctly by
> your algorithm -- it treats the ID column as important, instead of the
> second column.

I may did not used the correct word to identify that kind of cell that
I named "Key cell". The objective of the "Key cell" is to identify a
"td" cell that have a relationships to a "th" cell at his right side
in the same row. The "td" rowspan attribute would need to match or be
lower than the corresponding "th". The inverse would show a data cell
"td" used as an heading cell "th".

The current relationships algorithm create a relationship for the
preceding "th" cell not following "th" cell.

> Without the scope="" attributes, I don't think that table
> would make much sense.

You have right that the proposed algorithm, for the first example in
the spec in the <th> element's section does not get handled correctly.

The question is: Why from a visual point of view, by excluding any
styling, can you feel that "Cats" cell and the "English speakers" cell
is know as a row group as highlighted in the source code with the
scope attribute set to "rowgroup"?

My answer is: Because the header cell is surounded by empty data cell
in his row. For me that represent a mix of a layout table combined
with a data table. A quick fix to the proposed algorithm would be at
the end of the data row processing, do a test to know if the header
cell is surrounded by empty data cell, that until the first real data
row is found in the rowgroup (tbody) section. If that is true, the
header cell scope can be determined as a rowgroup header and the
surrounded empty data cell can be know as layout cell. Is that make
sense? Have you another visual logic regarding that case?

> Similarly, the "Characteristics with positive and
> negative sides" example used a number of times in the HTML spec works
> better with a few headers="" attributes to define the mappings than
> without, as far as I can tell

The raison you need the "headers" attributes is because the current
relationships algorithm do not support the "Key cell" relationship as
explained above.

> (though your algorithm does make a valiant
> attempt, I will grant you).

Thank you, I will do my best to explain the table usability concept.

> > Proposal: Table Usability API
> This is a very elaborate and large API. What are the use cases against
> which to evaluate it? i.e. what problem does it solve?

The main use case is to parse a complex table and extract the data in
the objectif to create an accessible (WCAG 2.0 Level AA compliant)
chart by using the progressive enhancement strategy. The use of the
table to create the chart remove the need for an web author to discus
and sometime debate with the content provider in the objectif to build
a descriptive text alternative version of the chart.

Also the proposed Table Usability API is not just to handle complex
table. The proposed API provide support access the tabular data either
by his row or by his columns. Sometime, for presentational purpose,
the axes are reversed.

As an example took the following two row table. Do you think, for
presentational purpose, it will be better have a two column table
instead? I think both table, with equivalent structure, should be
supported and have an equivalent accessible API.

(reference: http://agora.ic.gc.ca/lineActivityRevenue_eng.cfm?p_auction_id=5.0&p_round_no=331)
<h2>Revenue Graph</h2>
<table class="wet-boew-charts wb-charts-line wb-charts-height-450
<caption>Standing High Bids (M$)</caption>

> > Proposal: Table Usability Parser Algorithm
> > https://github.com/duboisp/Table-Usability-Concept/tree/master/Algorithm
> Can you elaborate on how this differs from the algorithm in the HTML spec,
> and in what ways it is better? (e.g. examples that your algorithm handles
> but that the HTML spec doesn't)
> I'm all in favour of improving the spec, I just don't have a good frame of
> reference here by which to evaluate the proposal.

Yes, I will do a more elaborated comparaison between the current and
the proposed algorithm. I will send an email later when that is

The proposed algorithm define a relationship model on how to get the
benefit of using the row grouping and the column grouping markup. When
the row grouping markup is not used, that algorithm are able to detect
which rows belong to the table head (thead) and are able to detect
simple row group and simple column group. Also the algorithm suggest a
real use case of using the 'colgroup' and 'col' element in a table.
That is made possible by using the proposed API in regards of
accessing the data by using the column instead of the row.

I found a lot of example where the 'colgroup' and 'col' element is use
for utilitarian purposes. But I was unable to find a example where the
'colgroup'  and the 'col' element is used to provide an
additional/supplemental information to the cell header (th) defined in
the table head (thead) section.

>From a row group perspective the specification define 3 kind of row
group (thead, tbody and tfoot). The algorithm define how to detect
those 3 kind of group in a column perspective.

The proposed algorithm define the relationships between groups (Data level).

> On Fri, 19 Oct 2012, Pierre Dubois wrote:
> >
> > Sometime the subsequent row grouping under the same data level and the
> > subsequent column grouping under the same data level don't necessary
> > mean a summary group but still a data group.
> A summary group is just a group with a heading saying it's a summary
> group, no? I don't really understand what is special about a summary
> group. How should software treat it differently?

Sometime a summary group is not clearly identified by using a cell
heading (th) but it is often identified by using the styling.
>From an accessibility (WCAG 2.0) point of view, by using styling to
define those summary group make it fail the Success Criterion 1.3.3
(Level A) "Sensory Characteristics"

Here a simple common example where a summary group do not have a
heading saying it's a summary group.

<table hassum>
<tr><th>Product 1</th><td>25.00</td></tr>
<tr><th>Product 2</th><td>60.00</td></tr>
<tr><th>Product 3</th><td>15.00</td></tr>
<tbody class="summary">
<tr><th>Sub Total</th><td>100.00</td></tr>
<tr><th>Federal Taxes</th><td>5.00</td></tr>
<tr><th>Provincial Taxes</th><td>10.00</td></tr>

The summary group concept can be useful to spec a responsive table
concept. For example, an user agent could hide some data group to
reduce the table space taken in view port. So in the previous
"Invoice" table, the user agent could hide the first row group and
provide a mechanism to display it, if requested by the user.

> > To fix that the solution would be to have a new attribute set on the
> > table element to know if the table contains summaries group.
> I would be very surprised if such an attribute was used correctly a useful
> fraction of the time.

If the responsive table is spec by having summary group, then I am
sure it would used correctly or at least to get the espected

> On Tue, 6 Nov 2012, Pierre Dubois wrote:
> >
> > Use case: Draw a graphic based on a data table
> > * Like a pie chart, based on a sub-set of data contained in a data table.
> This is an interesting use case. Do any sites actually try to do this
> today?

Any website that use the Web Experience Toolkit chart plugin
(https://github.com/wet-boew/wet-boew/wiki/Charts-and-graphs) and any
website that use the Filament Group chart

> I tried writing an example to do this, and it's not clear to me that the
> API is particularly hard to use. Somewhat verbose, granted, but it only
> took a few lines of code, most of which is spent in canvas logic and in
> the CSS styles to make the table presentable:
>   http://damowmow.com/playground/demos/tables/002.html
> That's an admittedly simple table; what kinds of tables are people
> generating pie charts out of? Are they more complex? Do you have any
> examples we could study?

> > An issue can be when the header cell cover and/or represent more than
> > one group (eg. multiple tbody from a column perspective and multiple
> > colgroup from a row perspective)
> Certainly that does make things more complex and the current API doesn't
> handle spanning cells well if you want to select a cell by grid position.

The goal with the following table is to generate a bar chart for the
data group and a line chart for the summary group. See the an example
of the espected result here:

(The cells relationships of the following table are not supported by
the current algorithm. The proposed algorithm support that kind of
complex table)
<table hassum>
<caption>Current account balances</caption>

<col />
<col />
<col />
<col />

<tr><th> <th>Goods<th>Other current account<th>Total

<tr><th colspan="4">2006
<tr><th>III <td>11 406 <td>-7010 <td>4396
<tr><th>IV <td>12 139 <td>-7437 <td>4702
<tr><th colspan="4">2007
<tr><th>I <td>13 563 <td>-10231 <td>3332
<tr><th>II <td>15 134 <td>-9516 <td>5618
<tr><th>III <td>9 510 <td>-7910 <td>1600
<tr><th>IV <td>9 230 <td>-7009 <td>2221
<tr><th colspan="4">2008
<tr><th>I <td>12 551 <td>-6387 <td>6164
<tr><th>II <td>16 095 <td>-10573 <td>5522
<tr><th>III <td>14 383 <td>-11603 <td>2780
<tr><th>IV <td>3 215 <td>-10763 <td>-7548
<tr><th colspan="4">2009
<tr><th>I <td>403 <td>-7498 <td>-7095
<tr><th>II <td>-2 019 <td>-10436 <td>-12455
<tr><th>III <td>-3 388 <td>-10382 <td>-13770
<tr><th>IV <td>436 <td>-10640 <td>-10204
<tr><th colspan="4">2010
<tr><th>I <td>1 103 <td>-10289 <td>-9186
<tr><th>II <td>-2 236 <td>-10747 <td>-12983
<tr><th>III <td>-6 504 <td>-11032 <td>-17536

> Can you be more elaborate? Examples of pages trying to do this, examples
> of tables that need to be charted client-side, etc, would go a long way
> towards helping flesh out the use case.

Generating client-side chart help about the Web Content Accessibility.
Generating client-side chart save money. It is faster to change a data
cell value of a HTML table instead of updating a non HTML data table
(like MS Excel), generating a new chart image, add the corporate look,
update the text alternatives version, upload the image, update the
webpage, ...

Pierre Dubois


More information about the whatwg mailing list