creating a data table web design – section 3-8 part or all of this lesson was adapted from the...

13
Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials

Upload: allen-mckinney

Post on 02-Jan-2016

214 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

Creating a Data Table

Web Design –

Section 3-8

Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials

Page 2: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

Objectives

The Student will: Understand the HMTL tags associated

with data tables. Be able create a simple data table

Page 3: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HMTL Tags for Tables HTML tables begin and end with table

elements: <table></table>. The opening table element should include a

summary attribute, which is read by screen readers in order to give blind users an overview of what the table contains and how it's organized. Being informed of this information up front helps blind users to more easily navigate the table and understand what they're hearing. Example: <table summary="Your brief table description here">

Page 4: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HMTL Tags for Tables

A table's caption (brief descriptive text, usually displayed above the table) begins and ends with caption elements: <caption>

Each row in a table begins and ends with table row (tr) elements: <tr></tr>

Page 5: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HMTL Tags for Tables

Each cell in the table begins and ends with either table header (th) elements or table data (td) elements, depending on what type of information the cell contains. If a cell contains headers, it begins and ends with

th elements: <th></th> If a cell contains data (not headers), it begins and

ends with td elements: <td></td>

Page 6: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HMTL Tags for Tables

Table header elements (th) should also include a scope attribute, which is either scope="row" or scope="col". This instructs screen readers as to which headers apply to which cells. Screen readers read tables row by row from left to right, and without this extra markup blind users would have a difficult time if the header applies to the column

Page 7: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HTML Table Example

Let’s look at the HMTL to create this table

Page 8: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HTML Table Example

<table summary="Two school lunch menu choices in two rows, with columns corresponding to school days Monday through Friday"><caption>School Lunch Menu</caption>

Page 9: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HTML Table Example

<tr><td> </td><th scope="col">Monday</th><th scope="col">Tuesday</th><th scope="col">Wednesday</th><th scope="col">Thursday</th><th scope="col">Friday</th>

</tr>

Page 10: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HTML Table Example

<tr><th scope="row">Carnivores</th><td>Sausage pizza</td><td>Corn dogs</td><td>Sloppy Joe</td><td>Beef taco</td><td>Chicken and dumplings</td>

</tr>

Page 11: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

HTML Table Example

<tr><th scope="row">Herbivores</th><td>Veggie pizza</td><td>Veggie dogs</td><td>BBQ tempeh</td><td>Bean burrito</td><td>Tofu teriyaki</td>

</tr></table>

Page 12: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

Summary Tables were introduced to the web with the

original purpose of displaying data in rows and columns.

Build tables using the table HTML tags Tables are built row by row.

Rest of Today Follow the instructions to create a table. This

does not go into your index.htm file. Create a file called table.htm

Page 13: Creating a Data Table Web Design – Section 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I”

Final Result Final table doesn’t look great but we will

come back to it later and clean it up.