Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print a tab

Status
Not open for further replies.

developer155

Programmer
Jan 21, 2004
512
US
how do I print a tab before a word. I have something like
<TD>Info</TD>

I need a tab before Info. I used this:
<TD>&#09 Info</TD> but it does nto do any good

thanks!!!
 

As far as I know, you cannot insert tabs into HTML. You could use any of the following methods, however:

- multiple non-breaking spaces
- left padding / margin (on the text or on the td)

Hope this helps,
Dan
 
Actually there are some possibilities:

- white-space: pre; - works in moz and IE6 (DTD compliance mode only)
- :first-line pseudo-class
- <PRE>...</PRE> tags. This turns text into fixed font (courier & stuff), adds ugly margins etc - but nothing that cannot be fixed with some extra CSS.
 
HTML 4.0 Specification:
9.3.4 Preformatted text: The PRE element
...
The horizontal tab character
The horizontal tab character (decimal 9 in ...) is usually interpreted by visual user agents as the smallest non-zero number of spaces necessary to line characters up along tab stops that are every 8 characters. We strongly discourage using horizontal tabs in preformatted text since it is common practice, when editing, to set the tab-spacing to other values, leading to misaligned documents.

 
Hi developer155,

This cell will have 50 pixels space before the word "info":

Code:
<TD STYLE="padding-left : 50px;">Info</TD>

If you place this in the [tt]<HEAD>..</HEAD>[/tt] section ..... :

Code:
<STYLE>
  .leftSpace {
    padding-left : 50px;
  }
</STYLE>

.... all these cells will have a 50 pixels space before the contents:

Code:
<TD CLASS="leftSpace">Info 1</TD>
<TD CLASS="leftSpace">Info 2</TD>
<TD CLASS="leftSpace">Info 3</TD>


... making it very easy to change the spacing in one line only!

Good Luck


Jakob

PS. This CSS property [tt]text-indent : 50px;[/tt] will do the same ...
 
Sorry.....

[tt]text-indent : 50px; [/tt] will indent the first line 50 pixels where

[tt]padding-left : 50px; [/tt] will keep 50 pixels clear to the left!


Jakob §;O)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top