YouTip LogoYouTip

Att Th Charoff

HTML th charoff Attribute .container { margin-top: 20px; } pre { background-color: #f4f4f4; padding: 15px; border-radius: 5px; overflow-x: auto; } code { font-family: 'Courier New', monospace; color: #d63384; } .btn-primary { background-color: #007bff; border-color: #007bff; } .btn-primary:hover { background-color: #0056b3; border-color: #0056b3; }

HTML th charoff Attribute

Learn not just technology, but also dreams!

HTML charoff Attribute

This attribute is used to specify the alignment offset relative to the character defined by the char attribute.

Note: The charoff attribute is not supported in HTML5 and has been deprecated in modern browsers.

Example

Align the content of the first table header cell with the "M" character positioned two characters to the right:

<table border="1">
  <tr>
    <th align="char" char="M" charoff="2">Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100.00</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$10.00</td>
  </tr>
</table>
Try it Yourself Β»

Browsers Support

Almost all mainstream browsers do not support the charoff attribute.

Definition and Usage

The charoff attribute is not supported in HTML5.

This attribute specifies the alignment offset relative to the character specified by the char attribute.

The charoff attribute can only be used when the align attribute is set to "char" and the char attribute is also defined.

Syntax

<th charoff="number">

Attribute Values

Value Description
number Specifies the alignment offset.
Positive number Aligns content to the right of the character.
Negative number Aligns content to the left of the character.
← Att Th ColspanAtt Th Char β†’