HTML <colgroup> charoffAttributes

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

Examples

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

<table width="100%" border="1">
  <colgroup align="left"></colgroup>
  <colgroup align="char" char="." charoff="2"></colgroup>
  <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:Almost all mainstream browsers do not support the charoff attribute.


Definition and Usage

In HTML5, the <colgroup> charoff attribute is not supported.

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

<colgroup charoff="number">

Attribute Values

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


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