Skip to content

Best Practices

  • WCAG Technique H39 Uses a descriptive caption.
  • WCAG Technique H63 Uses scope="col" and scope="row" to explicitly define header relationships.
  • Every piece of data has its own semantic cell, no <br> tags used for layout.
Employee Directory and Assigned Departments
IDEmployee NameDepartmentOffice Location
101John DoeEngineeringBuilding A, Room 12
102Jane SmithMarketingBuilding B, Room 4
103Alice WilliamsHuman ResourcesBuilding A, Room 2
  • rather than creating a massive table with complex colspan and rowspan attributes (which can be difficult for screen readers to navigate, even when done correctly), the data is broken up into two simpler tables
  • WCAG Technique G18 uses high-contrast zebra striping to aid users with cognitive or reading difficulties without sacrificing readability.
Q1 Hardware Inventory: Laptops
ModelIn StockAssignedOn Order
Dell XPS 1512455
MacBook Air M283010
Lenovo ThinkPad15600
Q1 Hardware Inventory: Mobile Devices
ModelIn StockAssignedOn Order
iPhone 142011015
Google Pixel 714405
iPad Pro 11”5252

While simplifying tables is preferred, if you must use a complex layout with merged cells, you must explicitly link the data to the headers.

  • WCAG Technique H43
    • Uses the id attribute on header cells and the headers attribute on data cells to unambiguously associate them, even across nested columns.
Employee Equipment Assignments
Employee NameAssigned Equipment
TypeModel
John DoeLaptopDell XPS 15
Jane SmithTabletiPad Pro