views:

4416

answers:

8

I would like to know if it's possible to insert a tab character in html instead of having to type   four times.

+2  A: 

AFAIK

The only way is to use

 

If you can use CSS then you can use padding or margin.

See

Box model

and for IE read

Internet Explorer box model bug

also

rahul
+11  A: 

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

Alohci
`padding-right`? Won't that sorta put the tab on the wrong side?
peirix
depends which element you're padding `;)`
nickf
Just to re-iterate Alohci's point. You *could* do this with html, but the style of a page should always be left to CSS. Separation, separation, separation ;)
Jon Hadley
+3  A: 
Will Robertson
+1  A: 

If whitespace becomes that important, it may be better to use preformatted text and the <pre> tag.

pavium
+1  A: 

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 &nbsp;

But &#09; is an ASCII tab.

Here is a complete listing of HTML entites.

kristian
+1  A: 

If you're looking to just indent the first sentence in a paragraph, you could do that with a small CSS trick

p:first-letter {
   margin-left: 5em;
}
peirix
what about text-indent? <code>p { text-indent: 5em }</code>
Dave
Yeah. That'll work too. Just remember to put it on `:first-letter` if the point is to indent only the first sentence.
peirix
A: 

If you are using CSS, I would suggest the following:

p:first-letter { text-indent:1em; }

This will indent the first line like in traditional publications.

Slevin
A: 

Why not just beautify your markup automagically using Pretty Diff tool?
http://mailmarkup.org/prettydiff/prettydiff.html