Home >> HTML 5 >> col Tag in HTML 5

col Tag in HTML 5

The <col> tag in HTML is used to set the column properties for each column within a <colgroup> tag.
 
Example
<!Doctype Html>  
<html>     
<head>      
       <title>Col Tag</title>
</head>  
<body>   
<table width="200" height="200" border="1">
   <colgroup>
       <col style="background-color:green">
       <col style="background-color:red">
    </colgroup>
    <tr>
        <th>Name</th>
        <th>Age</th>
    </tr>
    <tr>
        <td>Ram</td>
        <td>22</td>
    </tr> 
    <tr>
        <td>Shyam</td>
        <td>24</td>
    </tr>
</table>
</body>  
</html>  
Output
Name Age
ram 22
shyam 24

Post Your Comment

Next Questions
colgroup Tag
data Tag
datalist Tag
dd Tag
del Tag
details Tag
dfn Tag
dialog Tag
dir Tag
div Tag
dl Tag
dt Tag
em Tag
embed Tag
fieldset Tag
figcaption Tag
figure Tag
font Tag
footer Tag
form Tag
frame Tag
frameset Tag
Heading Tag
head Tag
header Tag

Copyright ©2022 coderraj.com. All Rights Reserved.