Tables Notes
- On a
Web page, there can be two types of tables: text and graphical.
- The
two-sided tag <PRE>text</PRE> will cause all enclosed text to
be displayed using a fixed-width font.
- <PRE>
is the HTML tag you would use to retain desired extra blank spaces, blank
lines, or tabs in a Web page table.
- Deciding
whether to use a text or a graphical table, creating the table structure,
and populating the table with data are all steps in creating a table in
HTML.
- When
creating a graphical table in HTML, the <TD> tags are used to
specify the location of each individual table cell.
- When
creating a graphical table in HTML, the number of rows in that table is
defined by the number of<TR>…</TR>two-sided tags that appear
between the<TABLE>tag and the </TABLE>tag.
- The
HTML tag that begins the definition of a graphical table is <TABLE>.
- If
five <TD>…</TD> two-sided tags appear within a <TR>tag,
the table has five columns.
- The
<TH> tag can be used to specify a table and column heading.
- One
way that the <TH>data</TH> two-sided tag differs from the
<TD>data</TD> two-sided tag is that data entered within the
<TH> tag pair will be centered in the cell.
- The
border width of a graphical table is measured in pixels.
- The
default value for the border property of a graphical table is 1 pixel.
- The
difference between the CELLSPACING and CELLPADDING properties of the
<TABLE> tag is that CELLSPACING specifies the width of a cell
border, while CELLPADDING specifies the size of the gap between a cell’s
text and the surrounding cell border.
- By
default, a browser places a table on the left margin of a page.
- <TD
ALIGN=CENTER VALIGN=MIDDLE> is the <TD> tag to use if you want
data to be positioned both vertically and horizontally in the center of a
table cell.
- The
numbers should be aligned on the right when creating a table that will
have a column containing numeric values, such as prices.
- The
width and height of a graphical table can be specified by size measured in
pixels and as a percentage of the display area.
- The
two-sided tag <TD WIDTH=50>1998</TD> specifies a cell that
occupies 50 pixels of the display area with the value 1998 left-aligned
in the cell.
- If a
browser supports table background extensions and you have written the code
<TABLE BGCOLOR=WHITE><TR BGCOLOR=GREEN><TD
BGCOLOR=YELOW>Hello</TD></TR></TABLE>, the text
“Hello” would appear on a yellow background.
- A
spanning cell is a cell that occupies more than one row or column in a
table.
- In the
tag <TD ROWSPAN=2>, the “2” refers to the number of rows to be
spanned.
- Besides
being used to display text and numbers in rows and columns, tables also
are commonly used to create a Web page layout.
- The
blank space that separates the material between two columns of a table is
referred to as a gutter.
- The
extension tag <TABLE BORDERCOLOR=color> is used to assign a color to
the border around the edge of a table.
- The
tag <! Begin table layout> is a comment that the browser will
ignore.