Tables – GCWeb design system
Tables are a design pattern for displaying data in rows and columns. They provide a structured way to communicate information.
Tables enable people to scan, understand, analyze, compare and act upon the information within them.
On this page
- Considering user needs
- Purpose of tables
- When to use
- When to consider alternatives
- How to implement
- Provide captions for tables
- Include clear and concise table headers
- Use the simplest table structure
- Align data in columns
- Order columns and rows by importance to the user
- Sort rows by importance to the user
- Provide filters so users can search and reorder table data
- Add pagination controls for large tables
- Code responsive tables based on screen size
- Consider styling rows with alternating colours or zebra stripes
- Avoid blank (empty) cells in tables
- Case study on improving and simplifying a table
- Meeting accessibility requirements
- Complementary components and functions
Considering user needs
Tables can be a useful choice for displaying information. However, you must be thoughtful in writing content and designing the layout for tables so that the information is easy to understand, accessible and usable for all users.
Using this pattern with UCD guidance supports:
- Users with small screens who have difficulty seeing all the content in a table at one time
- Assistive technology so users accessing content through screen readers can navigate easily and effectively
- Displaying data that is too detailed or precise to be described in text
- Scanning by users to help them quickly find the information they need
Use a table only if there isn’t a simpler way to present your content, such as a list, or in text. Review your content, this page of guidance and the list of available patterns in the UCD Guide to determine if a table is the best design choice to present the information.
Purpose of tables
Tables organize and present data, such as financial, statistical, comparative or numerical information.
Common user tasks in tables include:
- Scan and find records that fit specific criteria
- View a single record or row of data
- Understand and compare data
- Take actions or make a decision based on data
When to use
- To organize related information (for example, Telephone numbers for personal taxes, benefits and trusts)
- To make complex information easier to understand by presenting it in a clear structure (for example, Claim period dates and deadlines)
- To enable users to look up specific information (for example, CRA Office and drop box locations or Travel advice and advisories)
- To highlight trends or patterns in data, although a graph may be better than a table to highlight patterns in data (for example, see graphs and tables in the Usability Performance Dashboard)
- To organize data that is too detailed or precise to be described properly in text (for example, Tax-Free Savings Account (TFSA) holders by age group)
When to consider alternatives
- When forcing text layout, consider using flexboxes, grids, or column count for lists
- When the information can be presented in a list or summarized simply in the text
Example of using a list instead of a table
Before: Poorly designed table
The following table is complex and poorly designed. It would be difficult for someone using a screen reader or a mobile device to access and understand the information.
Eastern Conference | Western Conference | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Team | Wins | Team | Wins | Team | Wins | Team | Wins | Team | Wins | ||
Montréal Canadiens | 22 | Toronto Maple Leafs | 11 | Ottawa Senators | 1 | Edmonton Oilers | 5 | Calgary Flames | 1 |
After: Bulleted lists (instead of complex table)
This complex table can instead be presented as 2 bulleted lists. This is easier for someone using a screen reader or a mobile device to access and understand the information.
National Hockey League Stanley Cup Canadian winning teams from 1927 to 2013
Eastern conference:
- Montreal Canadiens had 22 wins
- Toronto Maple Leafs had 11 wins
- Ottawa Senators had 1 win
Western conference:
- Edmonton Oilers had 5 wins
- Calgary Flames had 1 win
Example of presenting the information in text instead of in a table
Before: Complex table
Eastern Conference | Western Conference | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Team | Wins | Team | Wins | Team | Wins | Team | Wins | Team | Wins | ||
Montréal Canadiens | 22 | Toronto Maple Leafs | 11 | Ottawa Senators | 1 | Edmonton Oilers | 5 | Calgary Flames | 1 |
After: Text presentation (instead of complex table)
If users don’t need information at such a high level of detail or precision, present the information in text. In this case, users likely only need to know which Canadian team won the most Stanley Cups during a certain time period.
National Hockey League Stanley Cup top Canadian winning team
From 1927 to 2013, the Montreal Canadiens won 22 Stanley Cups and that was the most won by a Canadian team.
How to implement
Provide captions for tables
Captions provide information that can help people find, navigate, and understand tables.
If there is a heading and a caption provided for one table, keep the caption and use the wb-inv
class so it can only be seen by screen readers.
Captions for tables
A caption describes the table’s purpose.
Captions help people:
- Find a table
- Understand what the table is about
- Decide if they want to read the table
A table caption should:
- Give a clear idea of what is in the table
- Be unique within the context of the page
- Be short and have no unnecessary words
- Start with the most relevant terms
- Make sense on its own
- Follow best practices similar as Headings and titles
A table caption should not:
- Give an interpretation of the data
- End with punctuation
- Contain abbreviations (unless the audience knows the abbreviation better than its long-form equivalent)
- Include promotional messaging (for example subjective claims)
Most screen readers announce the content of captions. When multiple tables are on a page, screen reader users can list all tables along with their captions. A unique caption makes it easier for screen reader users to identify and jump to the specific table they are interested in.
Example of a caption for a table
Caption: Availability of holiday accommodation
Include clear and concise table headers
There are 2 types of table headers:
- Column headers
- Row headers
Column and row headers
- Give each column and row a unique header that describes the data in that column or row.
- Keep headers as short as possible
- Add units of measure in a row or column header, instead of repeating them in each data cell.
Example: Column headers with units of measure
City | Minimum temperature (°C) | Maximum temperature (°C) | Rainfall (mm) |
---|---|---|---|
Canberra | 10.7 | 24.4 | 52.6 |
London | 3.8 | 10.3 | 48.0 |
Nairobi | 13.1 | 25.6 | 92.8 |
New Delhi | 15.4 | 29.7 | 14.7 |
Tokyo | 5.6 | 13.3 | 117.5 |
By looking at the column headers "City", "Minimum temperature (°C)" and " Maximum temperature (°C)" and “Rainfall (mm)”, people can understand that the city of Nairobi has a minimum temperature of 13.1 °C, a maximum temperature of 25.6 °C, and rainfall of 92.8 mm.
People using screen readers can have the row and column headers read aloud as they navigate through the table. Screen readers speak one cell at a time and reference the associated header cells, so the reader doesn’t lose context.
Use the simplest table structure
It can be difficult to make complex tables accessible and easy to read for people using screen readers or mobile devices.
To make tables useful to the widest possible audience:
- Keep table data short, clear and concise
- Include only data that is relevant to what you are communicating (to help minimize the table size)
- Turn a complex table into one or more simple tables
- Avoid merged cells (as they can be difficult for some people to understand and they pose accessibility issues)
- Avoid tables nested within other tables, they can be difficult for people to understand and pose accessibility issues
- Only use an image of a table when an HTML version is not viable, but there must be a full text version for people using mobile devices or using assistive technology
- If a table has footnotes, place them at the point of need, usually just after the table
- If there are multiple tables on page with footnotes, each footnote needs a unique label
Example: Turning a complex table into one or more simple tables
Before: A single complex table
The following table is complex and poorly designed. It would be difficult for someone using a screen reader or a mobile device to access and understand the information.
Eastern Conference | Western Conference | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Team | Wins | Team | Wins | Team | Wins | Team | Wins | Team | Wins | ||
Montréal Canadiens | 22 | Toronto Maple Leafs | 11 | Ottawa Senators | 1 | Edmonton Oilers | 5 | Calgary Flames | 1 |
After: One simple table
The complex table easily converts into a simple table.
Team | Wins | Conference |
---|---|---|
Montréal Canadiens | 22 | Eastern |
Toronto Maple Leafs | 11 | Eastern |
Edmonton Oilers | 5 | Western |
Calgary Flames | 1 | Western |
Ottawa Senators | 1 | Eastern |
After: 2 simple tables
If it's important to highlight Stanley Cup championships by NHL conference (region):
- Present the information using 2 simpler tables
- Use table titles to clarify which conference the teams represent.
Team | Wins |
---|---|
Montréal Canadiens | 22 |
Toronto Maple Leafs | 11 |
Ottawa Senators | 1 |
Team | Wins |
---|---|
Edmonton Oilers | 5 |
Calgary Flames | 1 |
Align data in columns
By default, most column data is left aligned (in left to right languages like English and French). This helps to make the data easily scannable, readable and comparable.
There is one exception to this for numeric data related to size. These numbers should be right aligned to help users identify number size.
Alignment rules for data
- Left align
-
- Textual data (for example: names, descriptions)
- Numeric data not related to size (for example: dates, time, phone numbers, ID numbers)
- Right align
-
- Numeric data related to size (for example: count, percent, dollars)
- Centre align
-
- Avoid and only use for very short data (for example: yes or no values)
Alignment rules for column headers
Align column headers according to their column data (for example: if column data is aligned to the left, the column header should be aligned to the left).
Order columns and rows by importance to the user
The order of the columns in a table should reflect the importance of the data to the user. Prioritize data with the most crucial information starting from the left column.
Related columns should be adjacent. For example, location details like address, city and country should be together. Placing these apart would create more work for users as they scroll or scan the table to compare columns.
Sort rows by importance to the user
The default sort order of rows should be by the first column of data and in an order which makes most sense for the user and the data context.
Sort order options for rows:
- Alphabetical (for city names)
- Chronological (for dates)
- Numerical (for claim periods)
- Ascending (A to Z, oldest date first, lowest number first)
- Descending (Z to A, most recent date first, highest number first)
You may want to allow users to reorder table data to suit their needs: Provide filters so users can search and reorder table data
Provide filters so users can search and reorder table data
Filters can be useful for users when tables are large, or people are looking for specific data or trends in the data.
Filters enable users to:
- Find the specific data that is relevant for their task
- Select a subset of data according to their needs
- Sort data in an order that is relevant to their need
- View trends in different aspects of the data
- Make large data tables usable on mobile devices
Table with filters for searching and reordering data
Disease/Condition Name | Sub-category |
---|---|
Mosquitoes and mosquito-borne diseases | Zoonotic (mosquito-borne) |
Acoustic Neuroma | Ear diseases |
Adjustment Disorder | Mental illnesses |
Alcohol use disorder | Mental illnesses |
Amyotrophic lateral sclerosis (ALS) | Musculoskeletal conditions |
Ankylosing spondylitis | Musculoskeletal conditions |
Bunions (hallax valgus) | Feet diseases and conditions |
Bruxism | Musculoskeletal conditions |
Flat foot (Pes Planus) | Musculoskeletal conditions |
Gastroesophageal reflux disease (Esophagitis) | Digestive diseases |
Glaucoma | Eye diseases |
Internal derangement knee | Musculoskeletal conditions |
Leg length inequality (anisomelia) | Musculoskeletal conditions |
Otosclerosis | Ear diseases |
Paget's disease of bone (osteitis deformans) | Musculoskeletal conditions |
Chronic Pancreatitis | Digestive diseases |
Peptic ulcer | Other |
Pilonidal disease | Other |
Chronic Plica Syndrome | Musculoskeletal conditions |
Psoriasis | Skin infections |
Rotator cuff disease | Musculoskeletal conditions |
Runner's heel (plantar fasciitis) | Musculoskeletal conditions |
Spondylolisthesis and spondylolysis | Musculoskeletal conditions |
Substance use disorders | Mental illnesses |
Tennis or golfer's elbow (epicondylitis) | Musculoskeletal conditions |
Tinnitus | Ear diseases |
Varicose veins and superficial thrombophlebitis | Heart and circulation conditions |
Vertigo | Ear diseases |
Learning disabilities (such as dyslexia and dysgraphia) | Learning disabilities (developmental disorders) |
Viral haemorrhagic fever | Haemorrhagic fever |
Visual disabilities | Eye diseases |
Ticks and tick-borne diseases | Zoonotic (tick-borne) |
Fungal meningitis | Fungal infection affecting brain and spinal cord |
Respiratory infectious diseases (such as flu, COVID-19, RSV) | Respiratory viruses |
Respiratory syncytial virus (RSV) | Respiratory diseases |
Mpox (monkeypox) | Zoonotic (animals), sexually transmitted infections (STI) (vaccine-preventable) |
Acute flaccid myelitis | Neurological condition |
Acute flaccid paralysis | Other |
Acute severe hepatitis in children | Liver diseases |
Acute respiratory diseases (Adenovirus) | Respiratory diseases |
African trypanosomiasis (sleeping sickness) | Zoonotic (tsetse fly) |
Allergies (airborne) | Allergies and intolerances (respiratory) |
Allergies (dermatitis) | Allergies and intolerances (skin) |
Allergies (latex) | Allergies and intolerances (skin, respiratory) |
Allergies and intolerances (foodborne) | Allergies and intolerances (food, digestive) |
Angina | Heart and circulation conditions |
Anthrax | Zoonotic (farm animals) |
Anxiety disorders | Mental illnesses |
Arthritis (rheumatoid, systemic lupus erythematosus, gout, juvenile or childhood) | Musculoskeletal conditions (joint) |
Atrial fibrillation | Heart and circulation conditions |
Asbestosis | Respiratory diseases |
Asthma | Respiratory diseases |
Athlete's foot (tinea pedis) | Skin infections |
Autism spectrum disorder | Learning disabilities (developmental disorders) |
Avian influenza (H5N1 bird flu) | Respiratory diseases, zoonotic (birds) |
Avian influenza A(H7N9, bird flu) | Respiratory diseases, zoonotic (birds) |
Bacterial vaginosis | Urogenital infections |
Beryllium disease | Respiratory diseases |
Bipolar disorder (manic-depression) | Mental illnesses |
Blastomycosis | Respiratory diseases |
Bone cancer (osteosarcoma, chondrosarcoma, ewing sarcomas) | Cancers |
Botulism | Food- and water-borne illnesses (food poisoning) |
Breast cancer | Cancers |
Brucellosis (undulant fever) | Food- and water-borne illnesses (food poisoning) |
Bursitis | Musculoskeletal conditions |
C. difficile (Clostridium difficile) | Gastrointestinal (enteric) diseases |
Camploybacteriosis (Campylobacter) | Food- and water-borne illnesses (food poisoning) |
Cancer | Cancers |
Cardiovascular diseases | Heart and circulation conditions |
Carpal tunnel syndrome (hand paresthesia and weakness) | Musculoskeletal conditions (hand) |
Cataracts | Eye diseases |
Cavities | Oral diseases (dental) |
Celiac disease (gluten-intolerance) | Allergies and intolerances (food, digestive) |
Cervical cancer | Cancers |
Chagas disease (American trypanosomiasis) | Zoonotic (triatomine bugs) |
Chickenpox (Varicella zoster virus) | Respiratory diseases (vaccine-preventable) |
Chikungunya | Zoonotic (mosquito-borne) |
Chlamydia | Sexually transmitted infections (STI) |
Cholera | Food- and water-borne illnesses (food poisoning)(vaccine-preventable) |
Chronic diseases and conditions | Other |
Chronic obstructive pulmonary disease (COPD) | Respiratory diseases |
Ciguatera | Food- and water-borne illnesses (food poisoning) |
Clostridium perfringens | Food- and water-borne illnesses (food poisoning) |
Colorado tick fever virus | Zoonotic (tick-borne) |
Colorectal cancer | Cancers |
Community-Acquired Methicillin-Resistant Staphylococcus aureus (CA-MRSA) | Skin infections |
Concussion | Brain injuries |
Coronavirus infection | Respiratory diseases |
Creutzfeldt-Jakob Disease (variant CJD, prion disease) | Neurological diseases |
Cronobacter (Enterobacter sakazakii) | Food- and water-borne illnesses (food poisoning) |
Cryptococcocus | Zoonotic (animals) |
Cryptosporidiosis (Cryptosporidium) | Food- and water-borne illnesses (food poisoning) |
Cyclospora | Food- and water-borne illnesses (food poisoning) |
Cytomegalovirus | Other |
De Quervain's disease | Musculoskeletal conditions (hand) |
Dementia | Neurological disease, mental illnesses |
Dengue fever | Haemorrhagic fever, zoonotic (mosquito-borne) |
Depression | Mental illnesses |
Dermatitis (irritant contact, eczema) | Skin infections |
Diabetes | Metabolic disorders |
Diphtheria | Respiratory diseases (vaccine-preventable) |
Dupuytren's contracture | Musculoskeletal conditions (hand) |
E. coli (Escherichia coli) infection | Food- and water-borne illnesses (food poisoning) |
Eating disorders (such as anorexia and bulimia) | Mental illnesses |
Ebola virus disease (EVD) | Haemorrhagic fever |
Echovirus | Other |
Emerging respiratory diseases | Respiratory diseases |
Epilepsy | Neurological diseases |
Farmer's lung (hypersensitivity pneumonitis) | Allergies and intolerances (respiratory) |
Fatigue | Other |
Fetal alcohol spectrum disorder (FASD) | Other |
Fibromyalgia syndrome (FMS) | Neurological diseases |
Flu (influenza) | Respiratory diseases (vaccine-preventable) |
Foodborne diseases (food poisoning) | Food- and water-borne illnesses (food poisoning) |
Frostbites | Weather related injuries |
Ganglion cyst | Musculoskeletal conditions |
Genital herpes | Sexually transmitted infections (STI) |
Giardia infection (giardiasis) | Food- and water-borne illnesses (food poisoning) |
Gonorrhea | Sexually transmitted infections (STI) |
Gum diseases (such as gingivitis and periodontal disease) | Oral diseases (dental) |
Group A streptococcus diseases | Bacterial infection |
Haemophilus influenzae (type b and non-b) | Respiratory diseases (vaccine-preventable) |
Hantavirus | Zoonotic (animals) |
Hearing loss | Ear diseases |
Heart attack | Heart and circulation conditions |
Heart diseases | Heart and circulation conditions |
Heart valve disorders | Heart and circulation conditions |
Hepatitis | Liver diseases |
Hepatitis A | Food- and water-borne illnesses (food poisoning)/Liver diseases (vaccine-preventable) |
Hepatitis B | Liver diseases, Sexually transmitted infections (STI) (vaccine-preventable) |
Hepatitis C | Liver diseases, Sexually transmitted infections (STI) |
Hepatitis D | Liver diseases |
Hepatitis E | Food- and water-borne illnesses (food poisoning)/Liver diseases |
Hepatitis G | Liver diseases |
High cholesterol | Heart and circulation conditions |
Histoplasmosis | Respiratory diseases |
HIV and AIDS (human immunodeficiency virus, acquired immune deficiency syndrome) | Sexually transmitted infections (STI) |
Human influenza A(H1N2)v with swine origin | Respiratory diseases |
Human Papillomavirus (HPV) | Sexually transmitted infections (STI) (vaccine-preventable) |
Hypertension - see High blood pressure | Heart and circulation conditions |
Hypothenar hammer syndrome | Musculoskeletal conditions (hand) |
Hypothermia | Weather related injuries |
Inflammatory bowel disease (IBD) | Digestive diseases |
Invasive meningococcal disease (meningitis) | (vaccine-preventable) |
Invasive pneumococcal disease | Respiratory diseases (vaccine-preventable) |
Japanese encephalitis | Zoonotic (mosquito-borne)(vaccine-preventable) |
Lassa fever | Haemorrhagic fever |
Legionnaires' disease and Pontiac fever (Legionellosis) | Respiratory diseases |
Leishmaniasis | Zoonotic (sand flies) |
Leprosy | Skin infections |
Leptospirosis | Zoonotic (animals) |
Listeriosis (Listeria) | Food- and water-borne illnesses (food poisoning) |
Lung cancer | Cancers (respiratory) |
Lyme disease | Zoonotic (tick-borne) |
Anaplasmosis | Zoonotic (tick-borne) |
Lymphocytic choriomeningitis virus (LCMV) | Zoonotic (animals) |
Lymphogranuloma venereum (LGV) | Sexually transmitted infections (STI) |
Macular degeneration | Eye diseases |
Malaria | Zoonotic (mosquito-borne) |
Marburg virus disease | Haemorrhagic fever, zoonotic (animals) |
Measles | Respiratory diseases (vaccine-preventable) |
Mental illnesses | Mental illnesses |
Middle East respiratory syndrome (MERS) | Respiratory diseases |
Multiple sclerosis (MS, disseminated sclerosis, encephalomyelitis disseminata) | Neurological diseases |
Mumps | (vaccine-preventable) |
Musculoskeletal disorders | Musculoskeletal conditions |
Neurological conditions (paralysis, seizures, epilepsy) | Neurological diseases |
Nipah Virus | Respiratory diseases, zoonotic (fruit bats) |
Non-polio enterovirus (such as coxsackievirus and D-68) | Other |
Non-Tuberculous Mycobacterium | Other |
Noroviruses (gastroenteritis, stomach flu) | Gastrointestinal (enteric) diseases |
Coronavirus disease (COVID-19) | Respiratory diseases |
Obesity | Metabolic disorders |
Oral cancer | Oral diseases(dental) |
Osteoporosis | Musculoskeletal conditions (bone) |
Pandemic flu | Respiratory diseases |
Parainfluenza virus | Respiratory diseases |
Parkinsonism, Parkinson's Disease (PD) | Neurological diseases |
Pelvic inflammatory disease | Urogenital infections |
Personality disorders | Mental illnesses |
Plague | Zoonotic (animals)(vaccine-preventable) |
Polio (Poliomyelitis) | Food- and water-borne illnesses (vaccine-preventable) |
Post-traumatic stress disorder (PTSD) | Mental illnesses |
Powassan virus disease | Zoonotic (tick-borne) |
Prion diseases | Prion diseases |
Proctitis | Sexually transmitted infections (STI) |
Prostate cancer | Cancers |
Psittacosis | Zoonotic (birds) |
Pubic lice and scabies | Sexually transmitted infections (STI) |
Q Fever | Zoonotic (animals) |
Rabies | Zoonotic (animals)(vaccine-preventable) |
Raynaud's phenomenon | Heart and circulation conditions |
Retinopathy | Eye diseases |
Rhinovirus (rhinitis, common cold) | Respiratory diseases |
Rift Valley Fever | Zoonotic (mosquito-borne) |
Ringworm (Dermatophytosis) | Skin infections |
Rocky Mountain Spotted Fever | Zoonotic (tick-borne) |
Rotavirus (infants diarrhea, gastroenteritis) | Gastrointestinal (enteric) diseases (vaccine-preventable) |
Rubella (German measles) | Respiratory diseases (vaccine-preventable) |
Salmonellosis (Salmonella) | Food- and water-borne illnesses (food poisoning) |
Sarcoidosis | Respiratory diseases |
SARS (Severe acute respiratory syndrome) | Respiratory diseases |
Scarlet fever (scarlatina) | Other |
Schizophrenia | Mental illnesses |
Scombroid poisoning | Food- and water-borne illnesses (food poisoning) |
Seoul virus | Zoonotic (animals) |
Severe lung illness related to vaping | Respiratory diseases |
Shellfish poisoning (paralytic amnesic and diarrhetic) | Food- and water-borne illnesses (food poisoning) |
Shigellosis (Shigella) | Food- and water-borne illnesses (food poisoning) |
Shingles (herpes-varicella zoster) | Skin infections (vaccine-preventable) |
Simian foamy virus | Zoonotic (animals) |
Skin cancer (melanoma and non-melanoma) | Cancers |
Sleep apnea | Respiratory diseases |
Smallpox (eradicated) | Respiratory diseases (vaccine-preventable) |
Staph (Methicillin-Resistant Staphylococcus aureus) | Skin infections |
Stroke | Heart and circulation conditions |
Sunburn | Weather related injuries |
Syphilis | Sexually transmitted infections (STI) |
Tendon disorders (tendonitis, tendinitis, tenosynovitis) | Musculoskeletal conditions (joint) |
Tetanus | (vaccine-preventable) |
Thyroid cancer | Cancers |
Tick-borne encephalitis | Zoonotic (tick-borne)(vaccine-preventable) |
Toxoplasmosis | Zoonotic (cats) |
Travellers' diarrhea | Food- and water-borne illnesses (food poisoning) |
Trichinellosis | Food- and water-borne illnesses |
Trichomoniasis | Sexually transmitted infections (STI) |
Tuberculosis (TB, MTB, tubercle bacillus) | Respiratory diseases (vaccine-preventable) |
Tularemia | Zoonotic (animals) |
Typhoid fever (Salmonella typhi) | Food- and water-borne illnesses (vaccine-preventable) |
Urethritis | Urogenital infections, sexually transmitted infections (STI) |
Vaccinia virus (poxvirus) | Skin infections |
Vaginal yeast infection (Vulvovaginal candidiasis) | Urogenital infections |
Valley fever (Coccidioidomycosis) | Other |
Venezuelan equine encephalitis virus (arbovirus) | Zoonotic (mosquito-borne) |
Vesiculovirus (Vesicular Stomatitis Virus) | Zoonotic (sand flies, animals) |
Vibrios (V. parahaemolyticus, V. vulnificus, V. alginolyticus) | Food- and water-borne illnesses (food poisoning) |
West Nile virus | Zoonotic (mosquito-borne) |
Whooping cough (Pertussis) | Respiratory diseases (vaccine-preventable) |
Windburn | Weather related injuries |
Worms (intestinal nematode infections) | Food- and water-borne illnesses |
Yellow Fever | Zoonotic (mosquito-borne) (vaccine-preventable) |
Zika virus | Zoonotic (mosquito-borne) |
Chronic pain | Other |
Add pagination controls for large tables
Pagination controls in tables give people the choice of how many table rows are displayed on a page. They help people navigate and view large tables in digestible amounts.
If there are more than 12 rows in a table, consider adding pagination controls.
The default number of rows displayed often varies between 5 and 25 rows. Choose the default number of rows based on what makes sense in the context of the table and how people use the data:
- If there is content on the page after the table, consider a lower default number of rows so that it’s easy for people to see the content that appears after the table
- If the data for each row is concise, consider a higher default number of rows
- If the data for each row is lengthy, consider a lower default number of rows
Code responsive tables based on screen size
Some devices may have screens that are too small to display the full width of the table content.
Responsive tables are able to:
- Adapt to different screen sizes while maintaining the logical order and structure of the data
- Prevent the need for horizontal scrolling or zooming on smaller screens
Coding responsive tables ensures that:
- People can easily read and interact with table data regardless of the device they are using
- People with disabilities who are using assistive devices can navigate and understand the table content effectively
For screens that are too small to display the full width of content, a responsive table can be coded to either:
-
Display a horizontal scroll bar
-
Split the table into separate smaller tables
Example: Responsive table based on screen sizes
Screen size:
Change the display size of your screen to view the changes in the responsive table below.
City | Population in 2007 | Population in 2017 | Percentage change |
---|---|---|---|
Toronto | 5,418,207 | 6,346,088 | 17.1% |
Montréal | 3,714,846 | 4,138,254 | 11.4% |
Vancouver | 2,218,134 | 2,571,262 | 15.9% |
Ottawa–Gatineau | 1,188,073 | 1,377,016 | 15.9% |
Consider styling rows with alternating colours or zebra stripes
Using alternating colours or “zebra striping” rows improves legibility, especially on long, complex tables. The striping helps people distinguish rows from each other.
Styling the even and odd rows in a different way can help people who have reading difficulties or who need to enlarge text.
Zebra stripes act as a visual guide so that people:
- Stay focused on the line they are analyzing
- Are less likely to lose their place or interpret the data wrong
Keep the contrast between the two colours subtle, but comply with the minimum colour contrast rules (1.4.3) from the Web Content Accessibility Guidelines (WCAG) 2.1.
Avoid other uses of colour or texture. If you must use textures and colours in a table, explain what the textures and colours mean (for example, in a table note or legend).
Avoid blank (empty) cells in tables
Do not use empty cells to format a table. Instead consider restructuring the table or using multiple tables. Assistive technologies like a screen reader will notify the person if the cell is blank.
Make your table as clear as possible to all audiences:
- If the value is zero, put “0” rather than leaving the cell blank
- If you don’t know what the value is, put “no data”
- If the cell shouldn’t have a value because the headings aren’t relevant, put “not applicable” or “n/a”
If it is necessary for a cell to have no value, explain why in your table's notes, legend or surrounding content.
Case study on improving and simplifying a table
What we did
To improve and simplify the following tables, we:
- Divided a complex table into several simple tables that are more accessible and can be viewed easily on mobile devices
- Provided the summary table first, followed by tables with increasingly detailed information (this means we applied the inverted pyramid approach)
- Created a clear title for each table
- Used existing subheadings previously embedded in the table cells to create table titles
- Added zeros to provide relevant information in otherwise empty cells
- Removed empty cells, rows and irrelevant information and subheadings
Examples before and after improving and simplifying a complex table
Example: Before (complex table)
Supporting Families and Communities (in $ millions) | 2013 to 2014 | 2014 to 2015 | Total |
---|---|---|---|
Support for Families | |||
Expanding Tax Relief for Home Care Services | 5 | 5 | 10 |
Palliative and End-of-Life Care | 1 | 1 | 2 |
Tariff Relief for Canadians Consumers | 76 | 76 | 152 |
Subtotal—Support for Families | 82 | 82 | 164 |
Investing in Communities | |||
Housing for Canadians in Need | |||
Homelessness Partnering Strategy | 119 | 119 | |
Investment in Affordable Housing | 253 | 253 | |
Investment in Nunavut Housing | 30 | 70 | 100 |
Supporting and Honouring Veterans | |||
Enhancing Veterans Affairs Canada's Funeral and Burial Program | 63 | 2 | 65 |
Road to 2017 | 1 | 2 | 3 |
Investments in Arts and Culture | |||
Massey Hall Revitalization | 8 | 8 | |
Expanding Library Services for the | |||
Blind and Partially Sighted | 3 | 3 | |
First-Time Donor's Super Credit | 25 | 25 | 50 |
Supporting the Economic Transition of Communities Economically Linked to the Chrysotile Asbestos Industry | 3 | 5 | 8 |
Subtotal—Investing in Communities | 133 | 476 | 609 |
Protecting Canada's Natural Environment | |||
Nature Conservancy of Canada | 20 | 20 | |
Improving the Conservation of Fisheries | |||
Through Community Partnerships | 5 | 5 | 10 |
Salmon Conservation Stamp | 1 | 1 | 2 |
Enabling Responsible Marine Management | 4 | 4 | |
Protecting Against Invasive Species | 2 | 2 | 3 |
Expanding Tax Support for Clean Energy Generation | 1 | 1 | |
Subtotal—Protecting Canada's Natural Environment | 32 | 9 | 41 |
Building Strong Aboriginal Communities | |||
Resolving Specific Claims | 27 | 27 | 54 |
First Nations Land Management Regime | 2 | 7 | 9 |
First Nations Policing Program | 18 | 18 | 36 |
Aboriginal Justice Strategy | 11 | 11 | |
Renewal of the Family Violence Prevention Program | 12 | 12 | 24 |
Improving Health Services to First Nations Communities | 24 | 24 | 48 |
Enhancing Mental Health Services in First Nations Communities | 2 | 2 | 4 |
Subtotal—Building Strong Aboriginal Communities | 95 | 90 | 185 |
Total—Supporting Families and Communities | 342 | 657 | 999 |
Less funds existing in the fiscal framework | 76 | 422 | 498 |
Less funds sourced from internal reallocations | 1 | 11 | 12 |
Net fiscal cost | 265 | 224 | 489 |
Note: Totals may not add due to rounding. |
Example: After (several simple tables)
Cost breakdown | 2013 to 2014 | 2014 to 2015 | Total |
---|---|---|---|
Total: supporting families and communitiestable 1 note 2 | 342 | 657 | 999 |
Less funds existing in the fiscal framework | (76) | (422) | (498) |
Less funds sourced from internal reallocations | (1) | (11) | (12) |
Net fiscal costs | 265 | 224 | 489 |
Table 1 Notes
|
Initiatives and programs | 2013 to 2014 | 2014 to 2015 | Total |
---|---|---|---|
Support for familiestable 2 note 2 | 82 | 82 | 164 |
Investing in communitiestable 2 note 3 | 133 | 476 | 609 |
Protecting Canada's natural environmenttable 2 note 4 | 32 | 9 | 41 |
Building strong Aboriginal communitiestable 2 note 5 | 95 | 90 | 185 |
Total: supporting families and communities | 342 | 657 | 999 |
Table 2 Notes
|
Initiatives and programs | 2013 to 2014 | 2014 to 2015 | Total |
---|---|---|---|
Expanding tax relief for home care services | 5 | 5 | 10 |
Palliative and end-of-life care | 1 | 1 | 2 |
Tariff relief for Canadian consumers | 76 | 76 | 152 |
Subtotal: support for families | 82 | 82 | 164 |
Table 3 Notes
|
Initiatives and programs | 2013 to 2014 | 2014 to 2015 | Total |
---|---|---|---|
Housing for Canadians in need | 0 | 0 | 0 |
Homelessness partnering strategy | 0 | 119 | 119 |
Investment in affordable housing | 0 | 253 | 253 |
Investment in Nunavut housing | 30 | 70 | 100 |
Supporting and Honouring veterans | 0 | 0 | 0 |
Enhancing Veterans Affairs Canada's Funeral and Burial Program | 63 | 2 | 65 |
Road to 2017 | 1 | 2 | 3 |
Investments in arts and culture | 0 | 0 | 0 |
Massey Hall revitalization | 8 | 0 | 8 |
Expanding library services for the blind and partially sighted | 3 | 0 | 3 |
First-time Donor's Super Credit | 25 | 25 | 50 |
Supporting the economic transition of communities economically linked to the chrysotile asbestos industry | 3 | 5 | 8 |
Subtotal: investing in communities | 133 | 476 | 609 |
Table 4 Notes
|
Initiatives and programs | 2013 to 2014 | 2014 to 2015 | Total |
---|---|---|---|
Nature Conservancy of Canada | 20 | 0 | 20 |
Improving the conservation of fisheries through community partnerships | 5 | 5 | 10 |
Salmon conservation stamp | 1 | 1 | 2 |
Enabling responsible marine management | 4 | 0 | 4 |
Protecting against invasive species | 2 | 2 | 3 |
Expanding tax support for clean energy generation | 0 | 1 | 1 |
Subtotal: protecting Canada's natural environment | 32 | 9 | 41 |
Table 5 Notes
|
Initiatives and programs | 2013 to 2014 | 2014 to 2015 | Total |
---|---|---|---|
Resolving specific claims | 27 | 27 | 54 |
First Nations Land Management Regime | 2 | 7 | 9 |
First Nations Policing Program | 18 | 18 | 36 |
Aboriginal Justice Strategy | 11 | 0 | 11 |
Renewal of the Family Violence Prevention Program | 12 | 12 | 24 |
Improving health services to First Nations Communities | 24 | 24 | 48 |
Enhancing mental health services in First Nations communities | 2 | 2 | 4 |
Subtotal: building strong Aboriginal communities | 95 | 90 | 185 |
Table 6 Notes
|
Meeting accessibility requirements
The Accessible Canada Act (ACA) requires that content created for the Canada Revenue Agency meets the goal of realizing a barrier-free Canada by 2040. For our digital products, Accessibility Standards Canada follows the European harmonized standard on Information and Communication Technology (ICT). The CRA uses the Web Content Accessibility Guidelines (WCAG) 2.1 to meet the ACA and must be compliant to WCAG level A and AA.
By following the guidance in the User-Centred Design Guide, your web content should meet the following WCAG success criteria:
- 1.3.1 Info and relationships (Level A)
- 1.3.2 Meaningful sequence (Level A)
- 1.4.4 Resize text (Level AA)
- 1.4.10 Reflow (Level AA)
- 2.4.4 Link purpose (in context) (Level A)
- 2.4.6 Headings and labels (Level AA)
While not required, to further enhance accessibility, more information on setting up and coding accessible tables is available from the W3C Web Accessibility Initiative Tables Tutorial.
Complementary components and functions
Additional add-on features and behaviours are available.
- Date modified: