HTML <col> charAttribute

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

Example

In the HTML table below, the content of the second column is aligned with the character '.':

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


Definition and Usage

HTML5 no longer supports the <col> char attribute.

The char attribute specifies the alignment of content related to the col element relative to a 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

<col char="character">

Attribute Values

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


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