English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
本文介绍HTML col char char 属性规定与 col 元素相关的内容相对某个字符的对齐方式,仅当 align 属性设置为 "char" 时,才能使用 char 属性。char 属性的默认值是页面语言的小数点字符。
在下面的 HTML 表格中,第二列的内容与字符点 "." 对齐:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML <col> char 属性使用-基础教程(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>Mês</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>Teste e veja ‹/›
IEFirefoxOperaChromeSafari
Atenção: Nenhum dos navegadores principais suporta o atributo char.
HTML5 O atributo char do <col> não é mais suportado.
O atributo char determina o alinhamento do conteúdo em relação a um caractere para o elemento col.
O atributo char pode ser usado apenas quando o atributo align estiver definido como "char".
O valor padrão do atributo char é o caractere decimal do idioma da página.
<col char="caractere">
Valor | Descrição |
---|---|
caractere | Define o caractere com que o conteúdo deve ser alinhado. |