English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de referência HTML

大全 de etiquetas HTML

HTML: propriedade charoff do elemento <th>

A propriedade charoff do elemento <th> define o número de caracteres com que o conteúdo deve ser alinhado em relação ao caractere especificado pela propriedade char. A propriedade charoff pode ser usada apenas quando a propriedade char está especificada e a propriedade align está configurada como "char".

 HTML <th> tag

Exemplo online

Alinhe o conteúdo da primeira célula de cabeçalho com os dois caracteres à direita do caractere "Y":

<table style="width:100%" border="1">
  <tr>
    <th align="char" char="Y" charoff="2">Year</th>
    <th>Income</th>
  </tr>
  <tr>
    <td>2018</td>
    <td>$15320.00</td>
  </tr>
  <tr>
    <td>2019</td>
    <td>$18320.00</td>
  </tr>
</table>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Almost all mainstream browsers do not support the charoff attribute.

Definition and usage

HTML5 The <th> charoff attribute is not supported.

The charoff attribute sets the number of characters to align the content with the character specified by the char attribute.

The charoff attribute can only be used when the char attribute is specified and the align attribute is set to 'char'.

Syntax

<th charoff="number">

Attribute value

ValueDescription
numberSpecify the alignment method.
Positive numbers align the character to the right.
Negative numbers align the character to the left.
 HTML <th> tag