Skip to McMaster Navigation Skip to Site Navigation Skip to main content
McMaster logo

MacSites

By Media Production Services

Tables

Although tables can be very helpful tools for presenting large quantities of data, they are often used in situations where it severely impacts the experience for users of assistive technology.

Best Practice for Using Tables in MacSites

  • Tables should not be used to control the layout of a page.
  • Tables should have a header row and/or header column.
    • Within MacSites, this must be added within the Text editor. Please see below for a step-by-step explanation.
  • Cells should not be merged as this can impact the reading order of the table.
  • Complex tables should be split into simpler tables when possible, especially to avoid the use of merged cells.
  • Empty cells should contain “No Data.”
  • The Caption checkbox should be selected and a meaningful title should be included for the table.
  • Header background colours can be changed by adding to the html code. Please see below for a step-by-step explanation.

Inserting Tables with the Visual Editor

Inserting tables with Pressbooks.
  • Insert a Table by using the Table button in the Visual editor.
Table properties button in Pressbooks.
  • Access the Table properties button in the Visual editor.
Table properties options.
  • Select the Caption checkbox and change the Class to Full Grid if you would like cell lines to be visible.

Improving Accessibility of Tables with the Text Editor

Accessible table code in the text editor.
  • The image above is the html code for the Example Table at the end of this page. Modifications were necessary to optimize the accessibility of this table.
  • The header row’s tags were changed from <td> (row) to <th> (header).
  • An accessible background colour was added to the style tag of header row (background-color: #dbdbdd;) to add visual emphasis.
    • #dbdbdd is McMaster’s Neutral Tint colour.

Example Table

Table Title Here
Header Row Header Row 2 Header Row 3
Data Cell 1 Data Cell 2 Data Cell 3
Data Cell 4 No Data Data Cell 5