HTML <th> charoff Attribute
Last Updated :
08 Feb, 2022
The HTML th charoff Attribute is used to sets the number of characters that aligned the characters specified by the char Attribute. This attribute can only be used in the char attribute and align attribute is specified in the th Element.
Note: The th charoff attribute is not supported by HTML 5.
Syntax:
<th charoff="number">
Attribute Values:
- number: It contains the numeric value which specify the alignment of the element.
- Positive values: indicate the alignment to the right of the characters.
- Negative values: indicate the alignment to the left of the characters.
Example: Below HTML code illustrates the use of charoff attribute in <th>.
HTML
<!DOCTYPE html>
< html >
< head >
< title >HTML th charoff attribute </ title >
< style >
body {
text-align: center;
}
h1,h2 {
color: green;
}
th {
color: blue;
}
table,
tbody,
td {
border: 1px solid black;
border-collapse: collapse;
}
</ style >
</ head >
< body >
< center >
< h1 >GeeksforGeeks</ h1 >
< h2 > HTML th charoff Attribute</ h2 >
< table >
< thead >
< tr align = "char" charoff = "." >
< th align = "char" charoff = "." >
Country_name
</ th >
< th >Total Medals</ th >
</ tr >
< thead >
< tbody >
< tr >
< td >China</ td >
< td >34</ td >
</ tr >
< tr >
< td >India</ td >
< td >45</ td >
</ tr >
</ tbody >
</ table >
</ center >
</ body >
</ html >
|
Output:
Supported Browsers: This attribute is depreciated from HTML5 and not in use.
Share your thoughts in the comments
Please Login to comment...