-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Table Design Pattern and Example: Initial Draft (pull #527)
1. Adds initial draft of table design pattern for issue #90. 2. Adds initial draft of table example HTML for issue #242; still needs CSS.
- Loading branch information
Showing
3 changed files
with
230 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.annotate{ | ||
font-style: italic; | ||
color: #366ED4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Table Example | WAI-ARIA Authoring Practices 1.1</title> | ||
|
||
<!-- Core js and css shared by all examples; do not modify when using this template. --> | ||
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/base.css"> | ||
<link rel="stylesheet" href="../css/core.css"> | ||
<script src="../js/examples.js"></script> | ||
<script src="../js/highlight.pack.js"></script> | ||
<script src="../js/app.js"></script> | ||
|
||
<!-- css for this example. --> | ||
<link href="css/table.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<h1>Table Example</h1> | ||
<p> | ||
<strong>NOTE:</strong> This example page is not complete and is not yet ready for review. | ||
Work on this page is tracked in | ||
<a href="https://github.com/w3c/aria-practices/issues/242">issue 242.</a> | ||
</p> | ||
<p> | ||
The below example illustrates an implementation of the WAI-ARIA | ||
<a href="../../#table">table design pattern.</a> | ||
Note that when possible, using a native HTML <code>table</code> element is recommended. | ||
</p> | ||
<p>Similar examples include: </p> | ||
<ul> | ||
<li><a href="../grid/LayoutGrids.html">Layout Grid Examples</a>: Three example implementations of grids that are used to lay out widgets, including a collection of navigation links, a message recipients list, and a set of search results.</li> | ||
<li><a href="../grid/dataGrids.html">Data Grid Examples</a>: Three example implementations of grid that include features relevant to presenting tabular information, such as content editing, sort, and column hiding.</li> | ||
<li><a href="../grid/advancedDataGrid.html">Advanced Data Grid Example</a>: Example of a grid with behaviors and features similar to a typical spreadsheet, including cell and row selection.</li> | ||
</ul> | ||
|
||
<section> | ||
<h2 id="ex_label">Example</h2> | ||
<div role="separator" id="ex_start_sep" aria-labelledby="ex_start_sep ex_label" aria-label="Start of"></div> | ||
<div id="ex1"> | ||
<div role="table" aria-label="Students" aria-describedby="students_table_desc"> | ||
<div id="students_table_desc">Students currently enrolled in WAI-ARIA 101 for the coming semester</div> | ||
<div role="rowgroup"> | ||
<div role="row"> | ||
<span role="columnheader">First Name</span> | ||
<span role="columnheader">Last Name</span> | ||
<span role="columnheader">Company</span> | ||
<span role="columnheader">Address</span> | ||
</div> | ||
</div> | ||
<div role="rowgroup"> | ||
<div role="row"> | ||
<span role="cell">Fred</span> | ||
<span role="cell">Jackson</span> | ||
<span role="cell">Acme, Inc.</span> | ||
<span role="cell">123 Broad St.</span> | ||
</div> | ||
<div role="row"> | ||
<span role="cell">Sara</span> | ||
<span role="cell">James</span> | ||
<span role="cell">Acme, Inc.</span> | ||
<span role="cell">123 Broad St.</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div role="separator" id="ex_end_sep" aria-labelledby="ex_end_sep ex_label" aria-label="End of"></div> | ||
</section> | ||
|
||
<section> | ||
<h2 id="kbd_label">Keyboard Support</h2> | ||
<p>Not Applicable</p> | ||
</section> | ||
|
||
<section> | ||
<h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2> | ||
<table aria-labelledby="rps_label" class="data attributes"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Role</th> | ||
<th scope="col">Attribute</th> | ||
<th scope="col">Element</th> | ||
<th scope="col">Usage</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th scope="row"><code>table</code></th> | ||
<td></td> | ||
<td><code>div</code></td> | ||
<td>Identifies the element containing the table structure.</td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<th scope="row"> | ||
<code>aria-label="Students"</code> | ||
</th> | ||
<td><code>div</code></td> | ||
<td>Provides an accessible name for the table.</td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<th scope="row"> | ||
<code>aria-describedby="IDREF"</code> | ||
</th> | ||
<td><code>div</code></td> | ||
<td>Refers to the element that serves as the caption for the table.</td> | ||
</tr> | ||
<tr> | ||
<th scope="row"><code>rowgroup</code></th> | ||
<td></td> | ||
<td><code>div</code></td> | ||
<td> | ||
<ul> | ||
<li>Identifies the elements that serve as containers for the table header and table body rows.</li> | ||
<li>Unlike HTML, WAI-ARIA does not include separate roles for the table header and table body row sets.</li> | ||
</ul> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th scope="row"><code>row</code></th> | ||
<td></td> | ||
<td><code>div</code></td> | ||
<td>Identifies each element that contains the cells for a row.</td> | ||
</tr> | ||
<tr> | ||
<th scope="row"><code>columnheader</code></th> | ||
<td></td> | ||
<td><code>span</code></td> | ||
<td>Identifies elements that serve as a cell containing a column label.</td> | ||
</tr> | ||
<tr> | ||
<th scope="row"><code>cell</code></th> | ||
<td></td> | ||
<td><code>span</code></td> | ||
<td>Identifies elements containing content for a single cell.</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</section> | ||
|
||
<section> | ||
<h2>Javascript and CSS Source Code</h2> | ||
<!-- After the js and css files are named with the name of this example, change the href and text of the following 2 links to refer to the appropriate js and css files. --> | ||
<ul> | ||
<li> | ||
CSS: | ||
<a href="css/table.css" type="tex/css">table.css</a> | ||
</li> | ||
<li> | ||
Javascript: Not applicable. | ||
</li> | ||
</ul> | ||
</section> | ||
|
||
<section> | ||
<h2 id="sc1_label">HTML Source Code</h2> | ||
<div role="separator" id="sc1_start_sep" aria-labelledby="sc1_start_sep sc1_label" aria-label="Start of"></div> | ||
<pre><code id="sc1"></code></pre> | ||
<div role="separator" id="sc1_end_sep" aria-labelledby="sc1_end_sep sc1_label" aria-label="End of"></div> | ||
<script> | ||
sourceCode.add('sc1', 'ex1'); | ||
sourceCode.make(); | ||
</script> | ||
</section> | ||
</main> | ||
<nav> | ||
<a href="../../#table">Table Design Pattern in WAI-ARIA Authoring Practices 1.1</a> | ||
</nav> | ||
</body> | ||
</html> |