Jump to main content.


Styles for Tables (of data)

Tables, if given a class of "table zebra", will be formatted like Table 2 and 3 (<table class="table zebra">). If given a class of "tablebord zebra", will be formatted like Table 1 (<table class="tablebord zebra">). If you just want alternating colored rows, simply give your table a class of "zebra" (<table class="zebra">).

There are a number of methods for creating accessible data tables. Here are two.


Tables with Borders

This table is marked up using scope.

This method is easiest for simple tables.

Example Table 1: Company data
Company Employees Founded
ACME Inc 1000 1947
XYZ Corp 2000 1973
JMJ Pensions 1 1986

Top of Page


Tables without Borders

These tables are marked up using headers. This technique also connects data cells with their header.

This technique is more complicated, and can be reserved for very complex or irregular tables.

Table 2 and 3 demonstrate headers.

Example Table 2: Contacts for the Fish Tissue Study
Name Location Phone Number Email
Leanne Stahl Washington, DC (202) 566-0404 stahl.leanne@epa.gov
Hilary Snook EPA Region 1
(CT, ME, MA, NH, RI, VT)
(617) 918-8670 snook.hilary@epa.gov
James P. Kurtenbach EPA Region 2
(NJ, NY)
(732) 321-6695 kurtenbach.james@epa.gov

Top of Page

Example Table 3: Company data
Employees Founded
Men Women
ACME Inc 700 300 1947
XYZ Corp 1200 800 1973
JMJ Pensions 0 1 1986

Top of Page

Description

Please look at the source code to see the formatting for these tables. Good overviews of creating accessible tables Exit EPA Disclaimer are easy to find.

Top of Page

For help with these pages, contact the Web Redesign Workgroup.


Local Navigation


Jump to main content.