• Aucun résultat trouvé

<colgroup> ... </colgroup>

The colgroup tag allows you to create a column-centric table as compared to the standard HTML table which is row-centric. The columns in the table are assigned to column groups using this tag. You can have one or more groups of columns.

If you are not using the span attribute of this tag, then you can use the col tag to assign attribute values to the individual columns within the colgroup elements.

The colgroup tag can only be used inside a table element.

The separate closing tag is mandatory.

Attributes and Events

class dir id lang onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup style title

align

The align attribute is used to set the horizontal alignment of the cell contents. The possible values are center, char, justify, left, and right.

char

The char attribute permits you to select a character that will be used to align the contents of the cells in a column. This was designed to allow the decimal points in a column of numbers to be in vertical alignment. The default value is country dependent. In the U.S., it is the first occurrence of a period or a decimal point.

charoff

The charoff attribute is an integer used to specify if the value designated in the char attribute is to be the first, second, or whatever occurrence.

span

The span attribute is used to set the number of columns that are associated with each column group. If the columns are dissimilar, however, use the col tag to create each column, rather than this attribute.

valign

The valign attribute is used to set the vertical alignment of the cell contents. The possible values are baseline, bottom, middle, and top.

width

The width attribute is used to set the width of each of the spanned columns. The value can be a percentage of the total width or an integer number of pixels.

Code:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">

<head>

<title>DevGuru XHTML colgroup Tag Example</title>

</head>

<body>

<table width="90%" border="10" cellspacing="5">

<caption>

<b>Column Group Table</b>

<br />

This table uses the <b>colgroup</b> and <b>col</b> tags

</caption>

<td>First Column First Row</td>

<td>Second Column First Row</td>

<td>Third Column First Row</td>

<td>Fourth Column First Row</td>

<td>Fifth Column First Row</td>

</tr>

<tr>

<td>First Column Second Row</td>

<td>Second Column Second Row</td>

<td>Third Column Second Row</td>

<td>Fourth Column Second Row</td>

<td>Fifth Column Second Row</td>

</tr>

This table uses the colgroupand coltags

First

First Column First Row

Second Column First Row

Third Column First Row

Fourth Column First Row

Fifth Column First Row First

Column Second Row

Second Column Second Row

Third Column Second Row

Fourth Column Second Row

Fifth

Column

Second

Row

TAG: dd

<dd>

The dd tag is used to create a definition list which is a type of listing where a term or phrase is followed by a definition or explanation. The dd tag presents the definition. It must be used with the dt tag which presents the term and the dl tag which delimits the start and stop of the definition list.

The exact appearance of a definition list can be browser dependent. Most browsers place the term on the left margin and then the definition is placed on the next line and the entire text is indented. However, if the term is short (3 characters or less) the definition may start on the same line as the term. The list is usually separated from preceding and following text by paragraph breaks.

The separate closing tag is mandatory.

Attributes and Events

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">

<head>

<title>DevGuru XHTML dd Tag Example</title>

</head>

<body>

Definition Lists:

<dl>

<dt>dl tag</dt>

<dd> definition list start and stop delimiter.</dd>

<dt>dt tag</dt>

<dd> presents the term or phrase to be defined.</dd>

<dt>dd tag</dt>

<dd> presents the definition for the term or phrase.</dd>

</dl>

definition list start and stop delimiter.

dt tag

presents the term or phrase to be defined.

dd tag

presents the definition for the term or phrase.

Documents relatifs