Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Applying header cells to complex tables

From: Web Accessibility Principles

Video: Applying header cells to complex tables

>> In more complex tables, the header information for a given cell might not be in the same row or column as that cell or the cell might have more than two headers that apply to it. In these cases, you need to use the headers attribute instead of the scope attribute to associate the data cell with its header cells. You do this by assigning an ID to each of the header cells and then listing the IDs of the applicable header cells in the headers attribute of the TD tag. Let's view an example of this sort of example in government.html.

Applying header cells to complex tables

>> In more complex tables, the header information for a given cell might not be in the same row or column as that cell or the cell might have more than two headers that apply to it. In these cases, you need to use the headers attribute instead of the scope attribute to associate the data cell with its header cells. You do this by assigning an ID to each of the header cells and then listing the IDs of the applicable header cells in the headers attribute of the TD tag. Let's view an example of this sort of example in government.html.

If you're following along with the exercise files, this page is located in the 07_05 folder of the chapter seven exercise files. Open it in Dreamweaver's design view. Scroll down the page past the meeting minutes table that we worked on earlier. A new table has been added to the page with the caption of comparison of adopted budget amounts and actual spending for transportation department 2004 to 2006. If we look at one of the numbers in the table, say this number 15 in the third row, we can see that it doesn't just have two heading cells.

The cell labeled dollars and millions is one of its heading cells, so is the cell labeled actual. But also the cell labeled 2006 - 2007 provides heading information for the number 15 in this cell. This is a case where TH cells and scope attributes of a row or column will not adequately describe how this cell is connected to the others around it. Sometimes these sorts of tables can be remade into a simpler form so that every data cell does only have one row heading to one column heading.

But there are many tables far more complicated and large than this example one that can be set up in a way that would give each cell only two header cells. This table already has some TH cells with scope set as you can see with the bold formatting that is applied to our TH cells. We want to keep the cells as TH cells and we want to keep the scope attributes, but we'll just add on to it from there. Let's look at the scope attributes for each of the cells under the fiscal year column. Click inside the first cell labeled 2006 - 2007.

Move down to the tag selector at the bottom of the document window and click on the TH tag. Now right click or control click on that tag and select quick tag editor. You can see the full HTML for this TH cell. We can see that it's standing three rows and that it has its scope set to row. However, this isn't correct. It's not just heading one row, but the entire group of three rows. So the value that we should use in the scope attribute is row group. Place your cursor after row in the scope attribute and add on the word group.

Now it's scope attribute more accurately describes what it is heading. There's also a scope attribute value of call group. It doesn't apply to this table, but that's also an option that you can use in your own tables. Let's make the same changes to the other fiscal year cells. Click in 2005 - 2006 then right click or control click on the TH tag in the selector and select quick tag editor. Type row group in the scope attribute. Then click on the 2004 - 2005 cell in the tag selector right click or control click on the TH tag and select quick tag editor.

Again, type row group in the scope attribute. Click outside the table. The next change we need to make is changing each of the items in the budget column to be table header cells as well. We can see that they are header cells by clicking in one of them and looking at the tag selector. The current tag is TD. The fact that their text is not bold is also a clue that they currently aren't set as TH tags. We'll use find and replace to quickly change all of these cells to TH cells with the scope attribute of row.

First go to the code view by clicking on the code button in the document tool bar. Select over the entire TD cell with the text adopted in it, including the opening TD tag, the text and its closing TD tag. Then go to the Edit menu and select find and replace. The HTML that was selected is automatically filled in the find field. We want to leave find in current document set and search source code set as well. With the text in the find field selected, hit control C or command C to copy and paste it into the replace field.

But then highlight over the D in the opening TD tag in the replace field and type H scope="row" then highlight over the D in the closing TD cell and type H. Uncheck the use regular expression box if it's currently checked. Now click on replace all. In the results panel, we can see that all three cells that had the text adopted in them have been changed to TH cells with a scope of row.

We'll repeat that for the remaining budget type cells. Go to the Edit menu and click on find and replace. Copy the text in the find field using control C or command C and paste it into the paste field using control V or command V. Change the text in the replace field to actual. Change the adopted text in the find field to actual as well and then highlight over all of the TH code, including the scope attribute and its value and type TD.

Also change the closing TH tag to a closing TD tag in the find field. Now click replace all. Finally, repeat this for the cells labeled different. Go to edit > find and replace, control C or command C to copy the text in the find field, control V or command V to paste the text into the replace field. Highlight over the text actual in the replace field and type difference.

Highlight over the text in the find field and also type difference. Then highlight over all of the TH code in the find field and type an opening TD tag and a closing TD tag then click replace all. So now we have all of the cells that are heading other cells correctly marked up as TH cells with their scope attributes set correctly as well. This gets the complex table closer to being fully accessible but we still haven't added the ID and headers attributes that I mentioned earlier.

We'll continue to improve this table in the next movie.

Show transcript

This video is part of

Image for Web Accessibility Principles
Web Accessibility Principles

68 video lessons · 25799 viewers

Zoe Gillenwater
Author

 
Expand all | Collapse all
  1. 2m 0s
    1. Welcome
      1m 3s
    2. Using the exercise files
      57s
  2. 33m 15s
    1. What does accessibility mean?
      5m 51s
    2. How does accessibility help your users?
      3m 30s
    3. Experiencing a website via a screen reader
      5m 46s
    4. How does accessibility help you and your clients?
      3m 9s
    5. Overview of Section 508 standards
      5m 51s
    6. Overview of WCAG standards
      6m 4s
    7. Understanding consistency and semantic markup
      3m 4s
  3. 54m 31s
    1. Understanding screen readers and accessibility tools
      6m 12s
    2. Getting accessible browsers
      5m 41s
    3. Customizing Firefox for accessibility testing
      5m 53s
    4. Using custom accessibility toolbars
      5m 28s
    5. Using Fangs and the Color Contrast Analyzer
      5m 30s
    6. Accessibility tools to bookmark
      5m 53s
    7. Using automated accessibility checking tools
      4m 57s
    8. Setting up the JAWS screen reader on Windows
      6m 42s
    9. Using the VoiceOver screen reader on Mac OS X
      5m 52s
    10. Setting Dreamweaver accessibility preferences
      2m 23s
  4. 26m 12s
    1. Avoiding tables for layout
      3m 30s
    2. Using CSS for layout
      2m 40s
    3. Creating a fixed-width layout
      5m 51s
    4. Creating an elastic layout
      3m 51s
    5. Creating a liquid layout
      3m 4s
    6. Customizing a liquid layout
      7m 16s
  5. 1h 6m
    1. Specifying the language
      3m 43s
    2. Setting page titles
      2m 16s
    3. Setting headings and paragraphs
      9m 55s
    4. Styling headings
      9m 56s
    5. Hiding section headings from sighted users
      6m 41s
    6. Styling text for readability
      6m 41s
    7. Ensuring proper color contrast
      6m 36s
    8. Creating text emphasis
      4m 29s
    9. Indicating quotations
      4m 29s
    10. Creating basic lists
      4m 16s
    11. Styling lists
      7m 15s
  6. 1h 15m
    1. Using lists for navigation
      6m 45s
    2. Creating a horizontal navigation bar
      13m 25s
    3. Creating a vertical navigation bar
      11m 44s
    4. Adding skip navigation links
      12m 0s
    5. Hiding skip navigation links
      6m 17s
    6. Proper link text and title attributes
      6m 11s
    7. Opening new windows
      4m 28s
    8. Accessibility limitations of fly-out menus
      6m 30s
    9. Creating an accessible fly-out menu
      8m 38s
  7. 27m 55s
    1. Proper ALT text for navigation images
      4m 57s
    2. Proper ALT text for decorative images
      5m 19s
    3. Adding ALT text to an existing site
      6m 9s
    4. Adding ALT text to image maps
      5m 58s
    5. Describing complex graphics
      5m 32s
  8. 34m 1s
    1. Using tables for data
      3m 0s
    2. Creating header cells
      4m 5s
    3. Adding table captions and summaries
      9m 9s
    4. Styling tables
      5m 19s
    5. Applying header cells to complex tables
      6m 52s
    6. Adding id and headers attributes
      5m 36s
  9. 42m 7s
    1. Understanding form accessibility issues
      3m 7s
    2. Labeling form fields
      6m 9s
    3. Adding fieldsets and legends
      4m 42s
    4. Moving forms out of tables
      3m 44s
    5. Cleaning up a form's appearance
      4m 53s
    6. Aligning labels and fields using CSS
      9m 39s
    7. Indicating required fields
      6m 15s
    8. Dealing with CAPTCHA
      3m 38s
  10. 7m 29s
    1. The Text-Only technique
      3m 21s
    2. The Access Keys technique
      2m 35s
    3. The Tab Index technique
      1m 33s
  11. 18s
    1. Goodbye
      18s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Web Accessibility Principles.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.