The HTML Elements reference.
"colgroup" - html element
- COLGROUP groups a set of 'col' elements.
- It allows you to group several semantically related columns together.
- Starttag <colgroup> is Required and endtag </colgroup> is Optional
-
Browsers that support the colgroup - element :
Element "colgroup" example:
<html>
<head>
<title>thead, tbody and tfoot element example</title>
</head>
<body>
<table border="8" cellspacing="5"
cellpadding="5" align="center">
<colgroup >
<col span="1" align="center" width="35" >
<col span="1" align="left" width="105" >
<col span="2" align="right" width="80" >
</colgroup>
<thead style="color:blue" >
<tr><td>Amount</td><td>Description</td>
<td>Unit Price</td><td>Price</td></tr>
</thead>
<tbody>
<tr><td >2</td><td>Bread.</td>
<td>4.0</td><td>8.00</td></tr>
<tr><td >6</td><td>Beer.</td>
<td>1.5</td><td>9.00</td></tr>
<tr><td >1</td><td>Butter.</td>
<td>3.0</td><td>3.00</td></tr>
</tbody>
<tfoot style="color:red" >
<tr><td></td><td>Summary:</td>
<td ></td><td >20.00</td></tr>
</tfoot>
</table>
</body>
</html>
Attributes:
align (deprecated), char , charoff , class , dir , id , lang , span (Initial: 1), style , title , valign , width (deprecated)
Attribute "align" value(s): depend on which element left, center, right, justify or char
align (deprecated), char , charoff , class , dir , id , lang , span (Initial: 1), style , title , valign , width (deprecated)
Attribute "align" value(s): depend on which element left, center, right, justify or char
- Specifies the horizontal alignment of its element with respect to the surrounding context. Specifies the alignment of data and the justification of text in a cell.
- You should use styles (CSS) instead.
Attribute value | description |
---|---|
left | Left-flush data/Left-justify text. This is the default value for table data. |
center | Center data/Center-justify text. This is the default value for table headers. |
right | Right-flush data/Right-justify text. |
justify | Double-justify text. |
char | Align text around a specific character. If a user agent doesn't support character alignment, behavior in the presence of this value is unspecified. |
© 2010 by Finnesand Data.
All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the
correctness in the pages or source codes.
The risk of using this web-site pages or any program
codes from this website is entirely at the individual user.