English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article introduces the HTML col char attribute, which specifies the alignment of the content related to the col element 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.
In the following HTML table, the content of the second column is aligned with the character point "." :
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML <col> char attribute usage-Basic Tutorial(oldtoolbag.com)</title> <style>table, th, td { border: 1px solid black;</style> </head> <body> <table style="width:100%"> <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> </body> </html>Test See ‹/›
IEFirefoxOperaChromeSafari
Note: All major browsers do not support the char attribute.
HTML5 The <col> char attribute is no longer supported.
The char attribute specifies the alignment of the 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.
<col char="character">
Value | Description |
---|---|
character | Specifies the character to align the content with. |