In an HTML document, the
Estimated reading time: 3 minutes
Syntax:
The
<col attribute="value">
HTML Tag:
th, td{ padding: 20px; }
| HTML
| Content categories | None |
| Permitted content | None, It is an empty element. |
| Tag omission | It must have an opening tag, but does not require a closing tag. |
| Permitted parents |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles | No role permitted |
| DOM interface | HTML TableColElement. |
Sample of HTML Tag:
Here is the example for HTML column tag:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
table, th, td {
border: 1px solid #666;
}
</style>
</head>
<body>
<h3>Sample of HTML <col> Tag</h3>
<table>
<colgroup>
<col span="2" style="width:20%; background-color:#eee;">
<col style="width:10%; background-color:#F5bf42;">
</colgroup>
<thead>
<th>Name</th>
<th>Gender</th>
<th>Age</th>
</thead>
<tr>
<td>Bella Smith</td>
<td>Female</td>
<td>19</td>
</tr>
<tr>
<td>Jack Johnson</td>
<td>Male</td>
<td>23</td>
</tr>
</table>
</body>
</html>
Result:
Download Sample File:
Attributes:
The
th, td{ padding: 20px; }
Attribute | Value | Description |
---|---|---|
align | The align attribute will help to set the alignment of the content of the column. Not supported in HTML5. | |
left | It aligns to the left. | |
right | Used to the right alignment. | |
center | Helps to align the center. | |
justify | This value helps to stretch the lines so that each line has equal width. | |
char | It is used to align a special character with a minimum offset , which is defined by the “char” and “charoff” attributes. | |
char | character | This value will align the content related to an |
charoff | number | Helps to shift the content of the cell relative to the character specified as the value of the attribute to the right (positive values) or to the left (negative values). It is used only if the attribute is aligned = “char”.** Not supported in HTML5.** |
span | number | Sets the quantity of columns , the properties of which are determined by the |
valign | The “valign” attribute helps to align the content vertically. | |
top | It helps to align at the top of the line. | |
bottom | This value used to align the bottom edge. | |
middle | Used for center or middle alignment. | |
baseline | This value is used for baseline alignment. Not supported in HTML5. | |
width | % pixels relative_length | It will set the width of the column. Not supported in HTML5. |
Browser Support:
Related Articles:
The post HTML
Column Tag appeared first on Share Point Anchor.
Top comments (0)