English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
charoff属性设置将内容与char属性指定的字符对齐的字符数。只有在指定了char属性并且align属性设置为“ char”的情况下,才能使用charoff属性。
在下面的 HTML 表格中,第二列的内容与字符 "." 向右两个字符的位置对齐:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML <col> charoff 属性使用-基础教程(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="." charoff="2"> <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>Voyons voir ‹/›
IEFirefoxOperaChromeSafari
Note : Aucun navigateur principal ne prend en charge l'attribut charoff.
HTML5 L'attribut charoff de <col> n'est plus pris en charge.
L'attribut charoff spécifie l'offset d'alignement du contenu par rapport au caractère spécifié par l'attribut char.
L'attribut charoff ne peut être utilisé que lorsque l'attribut align est réglé sur "char" et que l'attribut char est déjà configuré.
<col charoff="number">
Valeur | Description |
---|---|
number | Définir l'alignement. Les nombres positifs sont alignés à droite du caractère. Les nombres négatifs sont alignés à gauche du caractère. |