HTML <col> charoffAttribute

HTML col 标签参考手册HTML <col> Tag

Example

In the HTML table below, the content of the second column is aligned two characters to the right relative to the "." character:

<table width="100%" border="1">
  <col align="left">
  <col align="char" char="." charoff="2">
  <tr>
    <th>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 »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Note:None of the major browsers support the charoff attribute.


Definition and Usage

HTML5 no longer supports the <col> charoff attribute.

The charoff attribute specifies the alignment offset for content 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 has been set.


Syntax

<col charoff="number">

Attribute Values

Value Description
number Specifies the alignment.
A positive number specifies alignment to the right of the character.
A negative number specifies alignment to the left of the character.


HTML col 标签参考手册HTML <col> Tag Other Extensions