This Wiki page is edited by participants of the WCAG Working Group. It does not necessarily represent consensus and it may have incorrect information or information that is not supported by other Working Group participants, WAI, or W3C. It may also have some very useful information.

Using Standard Text Formatting For Tables

Jump to: navigation, search


  • entered by PeterKorn


Plain text documents. Not applicable to technologies that contain markup. This technique relates to:

  • Success Criterion 1.3.1 (Info and Relationships)
    • How to Meet 1.3.1 (Info and Relationships)
    • Understanding Success Criterion 1.3.1 (Info and Relationships)


The objective of this technique is to use text formatting conventions to create tables. Tables are used to display tabular data in columns, so that the contents of a given cell may be clearly associated with other cells sharing the same row or column. Column headers are also clearly discernible.

There are two procedures for creating tables in plain text documents. Both of these are visually discernible using fixed with characters (these techniques were designed for generation on devices like typewriters, or display on fixed character terminals.

Procedure 1: Using character graphics

Use character graphics to create the table structure. The underscore character "_" is used for horizontal lines, while the pipe character "|" is used for vertical lines. Column headers are indicated by being centered and in ALL CAPS. If present, row headers are indicated similarly - by being centered an in ALL CAPS. No blank lines are used within each table cell.

Procedure 2: Using spacing alignment

Use blank space after the contents of each cell such that each column of cells shares the same left alignment within each line of text. If present, column headers are indicated by an initial row, which is then underlined with dash characters "-". This initial row may or may not be similarly aligned; spacing in the dashes is sufficient to demarcate the headers.


Example 1: Using character graphics

Example Code:

Table with only column headers:
|       COL 1 HEADER          |       COL 2 HEADER          |
| Contents of first cell      | Contents of second cell     |
| Contents of third cell      | Contents of fourth cell     |
| Contents of fifth cell      | Contents of sixth cell      |

Table with column and row headers:
|                             |       COL 1 HEADER          |       COL 2 HEADER          |
|       ROW 1 HEADER          | Contents of first cell      | Contents of second cell     |
|       ROW 2 HEADER          | Contents of third cell      | Contents of fourth cell     |
|       ROW 3 HEADER          | Contents of fifth cell      | Contents of sixth cell      |

Example 2: Using spacing alignment

Example Code:

Table without column headers (a common UNIX directory listing):

$ ls
bin    etc         initrd.img.old  lost+found  proc        selinux  usr
boot   export      lib             media       RAID-ARRAY  srv      var
cdrom  home        lib32           mnt         root        sys      vmlinuz
dev    initrd.img  lib64           opt         sbin        tmp      vmlinuz.old

Table with aligned column headers (a common UNIX filesystem listing):

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              40G  8.8G   29G  24% /
none                  748M  288K  748M   1% /dev
none                  752M  916K  751M   1% /dev/shm
none                  752M  552K  752M   1% /var/run
none                  752M     0  752M   0% /var/lock
none                  752M     0  752M   0% /lib/init/rw
none                   40G  8.8G   29G  24% /var/lib/ureadahead/debugfs
/dev/md0              466G  396G   71G  85% /RAID-ARRAY
/dev/sda1             962M   81M  832M   9% /boot
/dev/sda4             185G  188M  176G   1% /export

Table with underlined column headers (a common network connection listing):

$ netstat
Active Connections

  Proto      Local Address          Foreign Address        State
  ------ ---------------------- ---------------------- ----------------
  TCP         lightnin:49157         ESTABLISHED
  TCP         lightnin:61839         ESTABLISHED
  TCP         lightnin:61843         ESTABLISHED
  TCP         lightnin:61844         ESTABLISHED
  TCP        lightnin:49165         ESTABLISHED
  TCP        lightnin:61851         ESTABLISHED
  TCP        lightnin:61881         ESTABLISHED
  TCP        lightnin:5354          ESTABLISHED
  TCP        lightnin:27015         ESTABLISHED
  TCP        lightnin:49209         ESTABLISHED
  TCP        lightnin:49208         ESTABLISHED
  TCP        lightnin:49344         ESTABLISHED
  TCP        lightnin:49343         ESTABLISHED


No resources available for this technique.

Related Techniques

(none currently listed)


Procedure 1


Procedure 2


Expected Results

  • All checks above are all true.

If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance.