Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab space instead of multiple non-breaking spaces ("nbsp")?

Tags:

html

Is it possible to insert a tab character in HTML instead of having to type   four times?

like image 899
Roch Avatar asked Oct 15 '09 11:10

Roch


People also ask

What we can use instead of &Nbsp?

In CSS property padding and margin can be used to tab space instead of non-breaking spaces (nbsp).

What does \t do in HTML?

It is equivalent to the tab character as such. Thus, from the HTML viewpoint, there is no need to “escape” it using the character reference; but you may do so e.g. if your editing program does not let you enter the character conveniently.

How do you make a tab space in HTML?

Adding Tab Space in HTML Unlike with HTML space, there is no particular HTML tab character you could use. You could technically use the 	 entity as the tab is character 9 in the ASCII. Unfortunately, HTML parsers will simply collapse it into a single space due to the whitespace collapse principle.


2 Answers

It depends on which character set you want to use.

There's no tab entity defined in ISO-8859-1 HTML - but there are a couple of whitespace characters other than   such as  ,  ,and  .

In ASCII, 	 is a tab.

Here is a complete listing of HTML entities and a useful discussion of whitespace on Wikipedia.

like image 98
kristian Avatar answered Oct 15 '22 17:10

kristian


It's much cleaner to use CSS. Try padding-left:5em or margin-left:5em as appropriate instead.

like image 36
Alohci Avatar answered Oct 15 '22 15:10

Alohci