Accessible PDFs – Complex Tables (5/5)

This is the last post of Accessible PDFs series of blogs that I am doing. You can view the other posts from

Tables

It is difficult for screen reader users to visualise tables unless they are correctly tagged. I have shown how Table headers and Data Cells should be defined in Accessible PDFs – Document Structure (2/5) blog post.

However, I wasn’t sure of how to make complex PDFs tables accessible. So I installed the NVDA (free screen reader) software and tried it myself. Here I will share what I learnt in the blog.

These two resources were very useful to me in developing my understanding of complex tables:

Complex Tables

Any table that has merged rows or columns or more than one level of heading are complex tables. I take the example here:

English Marks Average

Maths marks Average

Girls

Boys Girls Boys
81 82 77

76

Here I have two merged cells making it a complex table.

First I assigned TH (Table Header) and TD (Table Data) to correct the table’s structure. If you are unfamiliar with how to do this please visit  Accessible PDFs – Document Structure (2/5) blog post.

However, NVDA screen reader was not reading the structure of the table correctly.

Listen to what NVDA read to me:

Transcript:

Table with three rows and four columns row one column one English Marks Average. Column two Maths Marks Average. Row two English Marks Average column one Girls. Maths Marks Average column two Boys. Column three Girls. Column four Boys. Row three English Marks Average Girls column one 81. Maths Marks Average column two 82. Column three 77. Column four 76.

This table structure is not correctly read out by the screen reader as it stands. We need to make use of Column Span, Row Span, Scope, ID and Associated Header Cell IDs to give the correct structure to the screen reader software.

English Marks Average and Maths Marks Average are column headers spanning two columns. So for the header cell English Marks Average in the Table Cell Properties I selected:

  • Type: Header Cell
  • Scope: None
  • Row Span: 1
  • Column Span: 2
  • ID: English (you can give any name you want as long as it makes sense to you. This is not read out by the screen reader and only used to indicate the structure)

Note: Scope should be selected as None.

Table Cell Properties options selected for header cell English Marks Average
Figure 1: Table Cell Properties for first level header

I did the same for Maths Marks Average header cell and gave ID as Math. If your table has headers spanning rows you will have to do similar to rows.

Second row carry second level header cells for my table. For each of these cells I selected Type: Header Cell and Scope: None and gave G1, B1 and G2, B2 as IDs.

IMPORTANT: You have to select Scope as None if you are setting heading IDs.

Next I added English as Associated Header Cell IDs for G1 and B1; and Math as  Associated Header Cell IDs for G2 and B2.

Table Cell Properties associating Header Cell IDs for second level headers
Figure 2: Table Cell Properties for second level header cell

Now for each of the data cells you have to do the same – that is for each data cell open Table Cell Properties and insert Associated Header Cell IDs. The order Associated Header Cell IDs appear on the screen is the order that the screen reader will read them. So make sure to associate them in the order that it should be presented to the screen reader user.  I know this because I tried the other way around to test.

Because I want the first level header and then the second level header read in that order, for third row first column I selected following Associated Header Cell IDs: English, G1. This will make the screen reader to say English Marks Average and then Girls before reading the value of the cell.

Table Cell Properties for first data cell
Figure 3: Table Cell Properties for first data cell

Once you assign all data cells with Associated Header Cell IDs the table will be fully accessible.

Now listen to how NVDA screen reader reads the table correctly.

Transcript:

In the first row column one and two and column three and four were merged. Table with three rows and four columns.  Row one column one through two English Marks Average. Column three through four Maths Marks Average. Row two English Marks Average column one Girls. English Marks Average column two Boys. Maths Marks Average column three Girls. Maths Marks Average column four Boys.  Row three English Marks Average Girls column one 81. English Marks Average Boys column two 82. Maths Marks Average Girls column three 77. Maths Marks Average Boys column four 76.