Web Design Table Formatting Assignment

Student Lessons

All lessons in this course are listed below, organized by unit and module. Lessons and their assignments are also listed in the Student Assignment Checklist, which must be completed regularly and turned in to your instructor.

Unit 1: Designing and Planning Web Pages

Module 1: Website Evaluation and Rubric Creation

Module 2: Color Theory

Module 3: Web Standards & Accessible Design

Module 4: Planning a Website

Unit 2: Creating Pages with HTML

Module 1: Pre-Coding

Module 2: Basic HTML Markup

Module 3: HTML Lists

Module 4: Creating Links

Module 5: Creating a Data Table

Unit 3: Formatting Web Pages with Style Sheets

Module 1: Introduction to Cascading Style Sheets

Module 2: Page Layout Techniques

Unit 4: Graphics

Module 1: Introduction to Web Graphics

Module 2: Creating a Web Photo Album

Module 3: Creating Navigation Buttons

Module 4: Creating a Web Page Banner

Unit 5: Overall Site Design and Management

Module 1: Website Navigational Systems

Module 2: Using an external style sheet

Module 3: Scripts and Server-side technologies

Module 4: Validating a Website

Unit 6: Introduction to Web Authoring Software

Module 1: Creating a Web Page using Web Authoring Software

Module 2 : Controlling Style using Web Authoring Software

Module 3 : Site Management using Web Authoring Software

Unit 7: Client Website

Module 1: Client Website

Copyright © 2005-2008 by University of Washington. Permission is granted to use these materials in whole or in part for educational, noncommercial purposes provided the source is acknowledged. This product was created with support from the National Institute on Disability and Rehabilitation Research of the U.S. Department of Education (grant #H133D010306), and is maintained with support from the National Science Foundation (grant #CNS-0540615). The contents do not necessarily represent the policies of the U.S. federal government, and you should not assume their endorsement.

Thomas Michaud walks you step by step through how to create a table in HTML, in this chapter from Foundations of Web Design: Introduction to HTML & CSS.

This chapter is from the book 

What are HTML tables used for? Think of spreadsheets or data you want to organize and present. Maybe you have statistics, a schedule, or a project you need to organize. Let’s see how each element is used.

Table Element

The element allows you to arrange and present data in rows and columns of cells. However, it can’t do much without its supporting cast: the (table row), (table data cell), and (table header) elements. So, let’s start out by using these basic elements with some common attributes.

Step 4.1.1

Open the table.html document in the fowd_ch04_folder and enter a table element inside the element.

Table Headings

The element holds the heading of each column. Let’s say you’re developing a reading list of your favorite books and you want columns for the authors, for the book titles, and for indicating if you’ve read each book.

Step 4.1.2

Add the three elements with the column topics within the tags.

Author(s)Book TitleRead?

Save your document and view the result in the browser (Figure 4.1).

Table Rows

The element defines the rows of your table. While the three elements already display as a “row,” the element gives structure and meaning to a row—and a table can have lots of rows.

Author(s)Book TitleRead?

The next row will add data about one of your favorite books. The data for each book will be contained in a row, between a set of tags. The first book is John Steinbeck’s The Grapes of Wrath, which you will affirm you’ve read.

Author(s)Book TitleRead? John Steinbeck The Grapes of Wrath Yes

When you view this site, notice that the data is above (not below) each heading and not within the borders of your table (Figure 4.2).

In order to get the data in the correct spot, you need to add another set of tags around each piece of data using the element.

Table Data Cell

The element defines the cells of your table and contains your data.

Step 4.1.3

In the example, the book’s name, the author’s name, and your “yes” or “no” (whether or not you’ve read the book) are your data. Each item of data needs to be within a element.

John SteinbeckThe Grapes of WrathYes

Now each cell of data is below the header it matches (Figure 4.3).

Table Border

In order to see your table a little more easily, you’re going to add a border around it. Although we’ve not discussed CSS (Cascading Style Sheets), this method is best for displaying borders.

Step 4.1.4

Add styles, within the tags located in the element, to show the border for the , , and elements within your HTML document (Figure 4.4).

FIGURE 4.4. Your CSS styles create a border around your table and data cells.

Order Headers and Data

Each has to be ordered according to the . So your first element should relate to the first element, the second element relates to the second element, and so on (Figure 4.5).

FIGURE 4.5. Illustration of an ordered layout for table headers and table data.

Table Caption

The element gives an overall title to the table. In this case, maybe you’d call it “My Reading List”—it’s actually a list of books that I have either read or want to read.

Step 4.1.5

The element for the table comes right after the opening tag. Go ahead and add it to your code.

My Reading List

Notice the text for the caption is placed above the table headers, but outside of the border (Figure 4.6).

FIGURE 4.6. The caption is added to the top of the table, but not within the border.

Table Header

The element helps to group your table header () cells.

Step 4.1.6

In this table, the header row is where the elements are: “Book Title,” “Author(s),” and “Read?” Simply add the opening tag before the opening tag and add the closing tag immediately after the closing tag for that row.

Table Body

The element groups the body—the set of rows where the content resides—of the table.

Step 4.1.7

Place the tags around the book list.

Table Footer

The element groups the summary (footer) area of the table. The summary of a table could show the copyright information for the data, give credit to who has created (or edited) the list, provide totals of column values, or indicate when the table was last updated.

Step 4.1.8

After the closing of the tag, add the tags. Within the element, add a element and element with the data Updated March 5, 2013.

Now you’ll view your document with the addition of your new elements (Figure 4.7).

FIGURE 4.7. The data in the now displays at the bottom of the table layout.

Spanning Columns

The attribute allows you to expand a data cell to span multiple columns in the table. So, in the example, you have the that consists of one row with three columns of data (Figure 4.8).

And, in the , you currently have one row with three elements (Figure 4.9).

However, the element has one row ( element) and only one element (Figure 4.10).

Step 4.1.9

You can tell that element to span multiple columns by adding the attribute (short for “column span”) and assigning a value (in this case, you want it to expand to three columns wide).

The result gives you a element that spans all three columns (Figure 4.11).

FIGURE 4.11. Your footer now spans all three columns of your table.

0 thoughts on “Web Design Table Formatting Assignment”


Leave a Comment

Your email address will not be published. Required fields are marked *