Skip to: content, navigation

by Ian Lloyd

charoff (HTML attribute)

Spec
Depr. Version
No HTML 4
Browser support full matrix
IE7 FF2 Saf3 Op9.5
None None None None
charoff="number"

Example

In the example the charoff is set to "2":

<table border="1">
  <colgroup align="char" char=":" charoff="2">
    <col/>
    <col/>
  </colgroup>
  <colgroup align="char" char="%" charoff="2">
    <col/>
    <col/>
  </colgroup>
  ⋮
</table>

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 "2" is chosen, as shown in the example HTML, the browser should align the cell contents two characters to the right of the specified character. If charoff were a negative value, "-2" for example, the alignment should be offset two characters to the left of the specified character. Note that there are a few uses of the word “should” in this paragraph, which should (there we go again) give you a hint about what to expect in the compatibility section for this attribute!

Value

This attribute takes an integer value, which can be positive or negative.

Compatibility

IE5.5None
6.0None
7.0None
Firefox1.0None
1.5None
2.0None
Safari1.3None
2.0None
3.0None
Opera9.2None
9.5None

This attribute 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.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters