Warning:
This wiki has been archived and is now read-only.

TablesAs2DStructures

From HTML WG Wiki
Jump to: navigation, search

Tables as 2D structures

Problem statement / use cases

  • Tables are inherently 2-dimensional structures despite the need to serialize them as 1-dimensional structures in HTML
  • Authors need adequate abstraction of tables from their data structure to work with them effectively
  • The DOM representation of tables is two 1-dimensional for the needs of authors
  • Implementations need clear requirements and other norms for the inheritance of table attributes

Proposed solutions

Specify a clear inheritance for attributes

Tables have both rows and columns and since tables are serialized in such a was as to place cells inside rows, inside the row groups of a table, the normal SGML/XML inheritance of attributes follows the reverse path: table → row group → row → cell. However, HTML as an application of SGML, XML or something else is not bound to this serialization structure. We should (as HTML4 did before) specify that inheritance of attributes is from both column and row. So a second inheritance path is: table → column group → column → cell. The cell then has to parents in terms of attribute inheritance and HTML needs to specify the final arbiter parents for the cell’s attribute values.

  • lang/xml:lang
  • dir
  • irrelevant (should apply to cells in column or group; needs to define how to handle partial cells where cell spans outside the irrelevant column or row)
  • style

Semi-semantic attributes dropped from HTML5 with no equal in CSS

  • align
  • char
  • charoff
  • width (apportions the columns according to MultiLenghts)
  • valign (contents of the cell rather than the element position)

Others proposed for HTML5

Specify a clear precedence (column/row) for CSS property inheritance

Using CSS to select a col or colgroup element must select the cells wholly (or partially?) contained within the col or colgroup. HTML5 must provide a norm for the order of precedence for column/colgroup and row/rowgroup selectors and the inheritance of properties on those elements.

Specify a clear precedence column/row for CSS descendant selectors

Using CSS to select a col or colgroup and then subsequent descendant selectors should also be applied from col and colgroup elements

Provide new DOM methods and attributes

To further treat tables as two-dimensional structures, HTML5 should provide new DOM methods for columns to provide analogous functionality to row (horizontal) methods. For example in addition to insertRow and deleteRow, HTML5 should specify insertColumn and deleteColumn.

Also perhaps:

  • tColgroups
  • columns
  • groupColumnsFromIndexToIndex
  • moveColumnFromIndexToIndex

Discussion and evaluation

Related bug reports



Email

WG members should post feedback and other discussion to the WG’s list serve (the URI for the links below provides date information). Search on this email subject.

See also