X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Style tabSize Property

Style Object Reference Style Object

Example

Set the tabSize of a <pre> element:

document.getElementById("myPRE").style.tabSize="16";

Try it yourself »


Definition and Usage

The tabSize property specifies the length of the space used for the tab character.

In HTML, the tab character is usually displayed as a single space-character, except for some elements, like <textarea> and <pre>, and the result of the tabSize property will only be visible for these elements.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The tabSize property is currently only supported in Chrome.

Firefox supports an alternative, the MozTabSize property.

Opera supports an alternative, the OTabSize property.

No browser is currently supporting the value as a length unit.


Syntax

Return the tabSize property:

object.style.tabSize

Set the tabSize property:

object.style.tabSize="number|length|initial|inherit"

Property Values

Value Description
number Default value 8. Specifies the number of space-characters that should be displayed for each tab-character
length Specifies the length of a tab-character. This property value is not supported in any of the major browsers
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: 8
Return Value: A String, representing the tab-size property of an element
CSS Version CSS3


Related Pages

CSS reference: tab-size property


Style Object Reference Style Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook