[ Pobierz całość w formacie PDF ]

’background’
The background properties set the background for cells in the column, but only if
both the cell and row have transparent backgrounds. See "Table layers and
transparency." [p. 220]
’width’
The ’width’ property gives the minimum width for the column.
’visibility’
If the ’visibility’ of a column is set to ’collapse’, none of the cells in the column
are rendered, and cells that span into other columns are clipped. In addition, the
width of the table is diminished by the width the column would have taken up.
See "Dynamic effects" [p. 227] below. Other values for ’visibility’ have no effect.
2 Aug 2002 21:33
216
Tables
Example(s):
Here are some examples of style rules that set properties on columns. The first
two rules together implement the "rules" attribute of HTML 4.0 with a value of "cols".
The third rule makes the "totals" column blue, the final two rules shows how to make
a column a fixed size, by using the fixed layout algorithm [p. 222] .
col { border-style: none solid }
table { border-style: hidden }
col.totals { background: blue }
table { table-layout: fixed }
col.totals { width: 5em }
17.4 Tables in the visual formatting model
In terms of the visual formatting model [p. 99] , a table may behave like a block-level
[p. 101] or replaced inline-level [p. 103] element. Tables have content, padding,
borders, and margins.
In both cases, the table element generates an anonymous [p. 103] box that
contains the table box itself and the caption’s box (if present). The table and caption
boxes retain their own content, padding, margin, and border areas, and the dimen-
sions of the rectangular anonymous box are the smallest required to contain both.
Vertical margins collapse where the table box and caption box touch. Any reposition-
ing of the table must move the entire anonymous box, not just the table box, so that
the caption follows the table.
caption’s margin
caption caption caption caption caption
table’s margin
217
2 Aug 2002 21:33
}
collapsed margin
Tables
Diagram of a table with a caption above it; the bottom margin of the caption is
collapsed with the top margin of the table.
17.4.1 Caption position and alignment
’caption-side’
Value:
top | bottom | left | right | inherit
Initial:
top
Applies to:
’table-caption’ elements
Inherited:
yes
Percentages: N/A
Media:
visual
This property specifies the position of the caption box with respect to the table
box. Values have the following meanings:
top
Positions the caption box above the table box.
bottom
Positions the caption box below the table box.
Captions above or below a ’table’ element are formatted very much as if they were
a block element before or after the table, except that (1) they inherit inheritable prop-
erties from the table, and (2) they are not considered to be a block box for the
purposes of any ’compact’ or ’run-in’ element that may precede the table.
A caption that is above or below a table box also behaves like a block box for
width calculations; the width is computed with respect to the width of the table box’s
containing block.
To align caption content horizontally within the caption box, use the ’text-align’
property.
Example(s):
In this example, the ’caption-side’ property places captions below tables. The
caption will be as wide as the parent of the table, and caption text will be left-justi-
fied.
caption { caption-side: bottom;
width: auto;
text-align: left }
17.5 Visual layout of table contents
Like other elements of the document language [p. 30] , internal table elements
generate rectangular boxes [p. 85] with content and borders. Cells have padding as
well. Internal table elements do not have margins.
2 Aug 2002 21:33
218
Tables
The visual layout of these boxes is governed by a rectangular, irregular grid of
rows and columns. Each box occupies a whole number of grid cells, determined
according to the following rules. These rules do not apply to HTML 4.0 or earlier
HTML versions; HTML imposes its own limitations on row and column spans.
1. Each row box occupies one row of grid cells. Together, the row boxes fill the
table from top to bottom in the order they occur in the source document (i.e., the
table occupies exactly as many grid rows as there are row elements).
2. A row group occupies the same grid cells as the rows it contains.
3. A column box occupies one or more columns of grid cells. Column boxes are
placed next to each other in the order they occur. The first column box may be [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • glaz.keep.pl