Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
>> We've seen how TH elements, table header cells, can tie related pieces of related information in a table together. Now let's look at the caption element and summary attribute of tables. If you're following along with the exercise files, open government.html in Dreamweaver. It's located in the 07_03 folder of the chapter seven exercise files. This page has not been changed from when we last worked on it. You may remember that there was a table of meeting minutes downloads on this page.
Scroll down in design view. You'll see a table of four rows, but notice that there's no row at the top of the table with table header cells. Let's insert a new table with better structure into the page and paste our data our of this old table into the new, improved one. Click at the end of the paragraph preceding the table and hit enter or return to start a new line. Then go to the insert menu in Dreamweaver and click on table.
In the table dialogue box, enter 5 for the number of rows. For the number of columns, enter 4. Leave the table width, border thickness, cell padding and cell spacing fields blank. For the header option, choose the both image. This will set TH cells on both the columns and rows of our table. Under accessibility, click inside the caption field. The caption is used to provide a brief description of your table.
It's basically its title or label. In this field, type recent meeting minutes. Don't select anything for the line caption option. Again, this is a formatting issue that is better controlled in CSS. Click inside the summary field. A table summary can be used to provide even more information than would fit in a caption. There's no limit to the length of a caption, but you just want it to be a brief, clear description of what the table is about.
If you think a more extended explanation of your table would be useful to screen reader users, the summary attribute is where you can add that. The icons in this table might make it a little bit confusing. Having icons in a table to click and download documents might be a little bit confusing for screen reader users, so we will write a summary for this table. Simply type a longer explanation of the purpose of the table. ( Typing ) >> I've typed this table provides the minutes from the last four public meetings to download in Microsoft Word DOC and Acrobat PDF formats.
Now click okay in the table dialogue box. The empty table is added to the page with its caption above it. If we scroll down you can see that the summary is not displaying on the page. It's not used by visual browsers, but it's there in the code if the screen reader or other device wants to take advantage of it. Now let's type our headings into the first row of the empty table. Click inside the first cell of the first row type the text type of meeting.
Click inside the second cell and type date. Then the third cell and type Microsoft Word. Then the fourth cell, type acrobat PDF. Now let's drag each of the meeting descriptions out of their cells and into the type of meeting column.
Highlight over town council then click on the highlighted text and drag it up into the first cell of the second row. You'll see that it, too, is bold. That's because we specified that we wanted headings not only on the columns, but also on the rows. The name of each meeting is really acting as a label for the cells further along in the row, so that's why we've chosen to make these cells headings as well. Next highlight over zoning department in the old table, click on it and drag it up to the first cell in the third row.
Then highlight over and drag town of Wardscott public schools into the first cell of the fourth row. And finally, highlight over town council in the old table and drag it up into the first cell of the last row of the new table. For the remaining cells, we can copy them into the new table more quickly by clicking in the first date cell and without releasing the mouse dragging diagonally down to the last PDF cell. This highlights all 12 of the remaining cells with the thick black border.
You can now release your mouse and hit control C or command C on the keyboard to copy the block of cells. Now you need to highlight over the same cells in the new table. Click in the cell beneath the date header cell. Keeping the mouse button pressed, drag diagonally down towards the last cell in the table. When the block of these 12 cells is highlighted with a thick black border, you can release your mouse and now hit control V or command V on the keyboard to paste in the old cells.
Now we can delete the old table. Simply highlight over it and hit backspace or delete. There's one more accessibility enhancement we may want to make to this table. Table heading cells can have the ABBR attribute added to them. This stands for abbreviation and it provides alternate text for the heading cells. Usually that alternate text is shortened text. The ABBR attribute is most useful in very large tables. A screen reader may read out the content of a heading cell before it reads out the content of the data cell that it is currently in.
So for instance, in this table, if the screen reader was in the cell 5/23/08 it might read date, town of Wardscott public schools, 5/23/08. This can be very helpful, but it can also be frustrating in a very large table if the text of the heading cells is very long and has to be repeated over and over again. In these cases you would use the ABBR attribute on the long table heading cell text. The full text of the heading cell would still be read when the table was first encountered, but when the heading is read out before the data of individual cells, the abbreviated form would be used instead.
So click inside the type of meeting cell. To select the entire cell go down to the tag selector at the bottom of the document window and click on the TH tag. Right click or control click on the TH tag listed in the tag selector and select quick tag editor. The full HTML of the currently selected tag is shown. Place your cursor before its closing bracket and type a space and immediately a menu of possible attributes appears.
The ABBR attribute is the first in the list. Double click it and it is added to the cell. For the value in between the quotation marks, type the word type. Hit enter or return to accept the changes to the cell. So what we've done here is set a shortened version of this heading cell text. Type of meeting would be read out when the table is first encountered, while the abbreviation that we entered would be all that was read before individual cells.
You don't have to use the ABBR attribute just for shortened text, however, there may be times where you would want to use it to provide longer text because that would be more understandable to screen reader users. For instance, if you had a table with math symbols as headings, you could use the ABBR attribute to type out the word that corresponds with that symbol to make sure that the screen reader will read the correct text even if it doesn't know what that specific symbol is.
So now we've looked at many of the HTML elements and attributes that can make a table more accessible. Next we'll talk about how to style tables so that you can use the correct semantic markup, but keep it consistent with your design.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.
Your file was successfully uploaded.