Column properties

There are several properties than can be applied to the <col> elements of a table.


PropertiesValuesDescription
border<length> <border-style> <color>it defines the border width, style and color.
background<color>it defines the background color.
width<length>it defines the column width.
visibilityhide | hidden | inherit | show | visibleit defines how the column is rendered.


snippet
<html>
<head>
<style>
*{border: 1px solid gray;}
col.col1{font-style:italic; backgroud:yellow;}
col.col2{visibility:hidden;}
col.col3{width:200px; color:blue;}
</style>
</head>
<body>
<table>
<colgroup>
<col width="50" class="col1">
<col width="150" class="col2">
<col class="col3">
</colgroup>
<tr><td>data 1</td><td>data 2</td></tr>
<tr><td>data 3</td><td>data 4</td></tr>
</table>
</body>
</html>
Related Tutorial