| Depr. | Version |
|---|---|
| No | HTML 4 |
| IE8 | FF2 | SA4 | OP10 | CH2 |
|---|---|---|---|---|
| None | None | None | None | None |
Syntax
Description
If
the align attribute is set to
"char", and the char attribute
has been set to a character—thus telling the browser that cell contents
should be aligned to a given character—the charoff
attribute is used to set a character offset. If a
charoff figure of "4" is chosen,
the browser should align the cell contents four characters to the right or
the specified character. If charoff were a negative
value, for example "-4", the alignment should be offset
four characters to the left of the specified character. Note that there
are a few uses of the word “should” in this description, which
should (there we go again) give you a hint about what to expect
in the Compatibility section for this attribute!
Example
In this example, the
charoff is set to align four characters to the
right of ":" (in columns 1, 2, 4) and two characters to
the left of "." (in column 3):
<table border="1"> <col align="char" char=":" charoff="4"/> <col align="char" char=":" charoff="4"/> <col align="char" char="." charoff="-2"/> <col align="char" char=":" charoff="4"/> ⋮ </table>
Value
The charoff
attribute takes an integer value, which can be positive or
negative.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| None | None | None | None | None | None | None | None | None | None | None | None | None | None | None |
This element is poorly supported and should not be relied upon.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.