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 align has the value char. 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 col element should span. The default is 1. All rows affected by span are formatted according to the attribute settings in col.

  • 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 value 2* makes the columns twice as wide as the others. The value 0* sets the width to the minimum needed to hold the column’s content. If col has a width attribute, it takes precedence over the width specified by a surrounding colgroup element.

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)

 

> back to the alphabetical list of elements

   

 

 

 

back to top