XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / col
(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
col
HTML 4.01 | HTML 5 |
HTML: <col>; XHTML: <col/> or <col />
Creates a table column so that attribute properties can apply to all cells in that column. The element col does not structurally group columns; that is the role of the element colgroup. Instead, it is an empty element allowing properties, such as CSS styles, to be assigned together. The col element must appear after the caption element and before all rows (tr) or row groups (thead, tbody, tfoot) within a table element.
Start/end tag
This is an empty element. HTML forbids an end tag. In XHTML, the element must end with a slash before the closing angle bracket. Developers can insert a space before the slash to improve backward compatibility with older browsers.
Attributes
Core, internationalization, events, global HTML 5 attributes
align="left|right|center|justify|char"Not available in HTML 5. Sets horizontal text alignment in one or more cells. The default is
left.char="Zeichen"Not available in HTML 5. Defines the character on which cell content aligns when
alignhas the valuechar. The default is a decimal comma adapted to the language in use. Most current browsers do not support this attribute.charoff="Länge"Not available in HTML 5. Defines the offset to the first alignment character. If a row has no alignment character, it should shift horizontally to the end of the alignment position. Most current browsers do not support this attribute.
span="Zahl"Specifies how many rows the
colelement should span. The default is1. All rows affected byspanare formatted according to the attribute settings incol.valign="top|middle|bottom|baseline"Not available in HTML 5. Defines vertical text alignment in the cells of a column.
width="Pixel, Prozentwert, n*"Not available in HTML 5. Specifies the width of columns affected by
col. Width can be specified in pixels, percentages or relative sizes (*). The value2*makes the columns twice as wide as the others. The value0*sets the width to the minimum needed to hold the column’s content. Ifcolhas awidthattribute, it takes precedence over the width specified by a surroundingcolgroupelement.
Example (HTML):
See also the elements colgroup and table.
<table>
<col span="2" width="100" class="Name">
<col span="1" width="50" class="Datum">
<thead> ... (weiteres Markup)Example (XHTML):
<table>
<col span="2" width="100" class="Name" />
<col span="1" width="50" class="Datum" />
<thead> ... (weiteres Markup)
|
Copyright © 2010 O’Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from "HTML & XHTML ─ kurz & gut" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de