HTML and CSS Reference
In-Depth Information
nonstandard valign attribute. So, in Internet Explorer you could place a caption at the
bottom of the table, aligned with the right edge like this:
<table>
<caption valign=“bottom” align=“right”>Torque Limits for Various Fruits</cap-
tion>
To create the same effect in all current browsers, you can use a combination of HTML
and CSS. To place the caption at the bottom right of the table, you would use the align
attribute and text-align property as follows:
<caption align=“bottom” style=“text-align: right”> This is a caption </caption>
In general, unless you have a very short table, you should leave the caption in its default
position—centered at the top of the table. That way your visitors will see the caption first
and know what they're about to read, instead of seeing it after they're already done read-
ing the table (at which point they've usually figured out what it's about anyway).
10
The align attribute was removed from HTML5. You should use the standard align CSS
property instead.
Spanning Multiple Rows or Columns
The tables you've created up to this point all had one value per cell or the occasional
empty cell. You also can create cells that span multiple rows or columns within the table.
Those spanned cells then can hold headings that have subheadings in the next row or col-
umn, or you can create other special effects within the table layout. Figure 10.21 shows a
table with spanned columns and rows.
FIGURE 10.21
Using span set-
tings to alter table
layout.
This cell spans two rows and two columns
This cell spans two rows
This cell spans two columns
 
 
Search WWH ::




Custom Search