36.2 Using the scope method to identify table cells

Table 36-1 lists the scope settings you can specify in the [Tables] section of the configuration file.

Table 36-1 WAI scope attributes for table cells

 

[Tables] setting

Default value

[TableAccess] override

Purpose

* Cells marked as ColGroup or RowGroup via [HtmlStyles]parafmt=*Group or CellGroup PI marker

Column

ScopeCol
No
ScopeCol

Apply scope="col" (the default) to column-header cells

ScopeColGroup
No
ScopeColGroup

Apply scope="colgroup" to ColGroup header cells*

Row

ScopeRow
No
ScopeRow

Apply scope="row" (the default) to row-header cells

ScopeRowGroup
No
ScopeRowGroup

Apply scope="rowgroup" to RowGroup header cells*

Use these settings to identify column and row header cells that apply to more than one body column or row, either explicitly or implicitly:

[Tables]
; ScopeCol = No (to not use) or Yes (to apply default scope="col"
;  to non-empty cells in table header)
ScopeCol=No
; ScopeColGroup = No (to not use) or Yes (to apply scope="colgroup"
;  instead of "col" to column head cells identified as ColGroup via
;  [HtmlStyles] or the CellGroup marker col; sets ColGroupElements).
ScopeColGroup=No
; ScopeRow = No (to not use) or Yes (to apply default scope="row"
;  to first non-empty cell in each row in the table)
ScopeRow=No
; ScopeRowGroup = No (to not use) or Yes (to apply scope="rowgroup"
;  instead of "row" to non-empty row-spanning cells at left in table;
;  applies "row" to non-spanning cells, so ScopeRow is not needed).
ScopeRowGroup=No

You can override each of these settings in the [TableAccess] section for selected tables by specifying the same setting, prefixed with No, as a property; see §36.4 Overriding default table-cell settings.

Note:  If you set AccessMethod=Scope, DITA2Go automatically sets ScopeCol, ScopeRow, ScopeColGroup, and ScopeRowGroup to Yes.

Columns and rows

ScopeCol applies to non-empty cells in rows that are tagged <th> or that are designated as header rows via [Tables]TableHeaderRows or [TableAccess]HRowsN.

ScopeRow applies to non-empty cells in the first (leftmost) column in the table, even if the cells in that column are tagged <td> instead of <th>; or to columns that are designated as row headers via [Tables]TableHeaderCols or [TableAccess]HColsN.

Groups of columns or rows

You can use scope=colgroup or scope=rowgroup to apply a header to all cells in a group. If you use column groups and row groups, you can specify a group scope even though none of the header cells spans more than one column or row.

For the group scope settings to be meaningful and effective, a table has to have the structure they imply. For example, scope="colgroup" works only if the table has column groups (<colgroup> elements), and scope="rowgroup" works only if the table has row groups (<tbody> elements). Therefore:

The group scope attributes work in concert with ColGroup and RowGroup cells: header cells that are assigned [HtmlStyles] property ColGroup or RowGroup, described in §35.2.2 Using paragraph formats for table-cell attributes; or that contain PI marker type CellGroup, described in §35.2.4 Using PI markers for table-cell attributes.

Note:  If any of your tables have footer rows, when you use scope="rowgroup" the resulting HTML might contain some surprises; see §33.3.2.5 Positioning table footer rows (deprecated) in §33.3.2.4 Wrapping table row groups.

Previous Topic:  36.1 Understanding table cell settings

Next Topic:  36.3 Using the id/headers method to identify table cells

Parent Topic:  36. Marking HTML table cells for WAI

Sibling Topics:

36.1 Understanding table cell settings

36.3 Using the id/headers method to identify table cells

36.4 Overriding default table-cell settings

36.5 Using ColGroup and RowGroup cells