HTML <colgroup> charAttribute

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

Examples

In the following example, the content of the second column in the table is aligned with the character ".":

<table width="100%" border="1">
  <colgroup align="left"></colgroup>
  <colgroup align="char" char="."></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 char attribute.


Definition and Usage

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

The char attribute specifies the alignment of content in a column group relative to a certain character.

The char attribute can only be used when the align attribute is set to "char".

The default value of the char attribute is the decimal point character of the page language.


Syntax

<colgroup char="character">

Attribute Values

Value Description
character Specifies the character to align the content with.


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