Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Summary 283

10


While working with tables, you learned about headings and data, captions, defining rows
and cells, aligning information within cells, and creating cells that span multiple rows or
columns. With these features, you can create tables for most purposes.


As you’re constructing tables, it’s helpful to keep the following steps in mind:


n Sketch your table, indicating where the rows and columns fall. Mark which cells
span multiple rows and columns.
n Start with a basic framework and lay out the rows, headings, and data row by row
and cell by cell in HTML. Include row and column spans as necessary. Test fre-
quently in a browser to make sure that it’s all working correctly.
n Modify the alignment in the rows to reflect the alignment of the majority of the
cells.
n Modify the alignment for individual cells.
n Adjust line breaks, if necessary.
n Make other refinements, such as cell spacing, padding, and color.
n Test your table in multiple browsers. Different browsers might have different
approaches to laying out your table or might be more accepting of errors in your
HTML code.

Table 10.1 presents a quick summary of the HTML elements that you learned about in
this lesson and that remain current in HTML5.


TABLE 10.1 Current HTML5 Table Elements
Tag Use


...
Indicates a table.
... Creates a caption for the table (optional).
...Encloses one or more columns in a group.
Used to define the attributes of a column in a table.
... Creates a row group that defines the heading of the table. A
table can contain only one heading.
... Creates a row group that defines the footer of the table. A
table can contain only one footer. Must be specified before
the body of the table is rendered.
... Defines one or more row groups to include in the body of the
table. Tables can contain more than one body section.
Free download pdf