Solved

Equivalent of 'TAB' in HTML

Posted on 2001-07-30
9
2,586 Views
Last Modified: 2008-03-17
Is there any tag in HTML to represent a tab?. I don't wish to specify &nbsp 8 times. (Assuming user has set tab = 8 spaces)
0
Comment
Question by:prashant_n_mhatre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6335919
Not that I know of.

Have you perhaps considered using the <pre></pre> tags? Not that I like to use them myself.

Compare:

<p>        Eight spaces before and after.        </p>
<pre>        Eight spaces before and after.        </pre>



:o)

Ant
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6335920
No but if there are multiple spaces you can preserve them without &nbsp; by enclosing the text in <pre> </pre> which will retain the formatting

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6335922
Sorry ant, didn't see your post.

Cd&
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 15

Expert Comment

by:a.marsh
ID: 6335923
There are lots of other ways you can use to get the same effect. One common way is to use a transparent gif and resize it accordingly to "indent" text.

Ant
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6335928
Just pipped you there! :oP

Great minds and all that!

:o)

Ant
0
 
LVL 4

Author Comment

by:prashant_n_mhatre
ID: 6336005
Thank you all!!!
I know <pre> and I use the same instead of &nbsp. Actually I was wondering if html supports some keyword that does the same job.
0
 
LVL 1

Accepted Solution

by:
coreyti earned 20 total points
ID: 6336691
What about CSS guys???

----------
<html>
<head>
     <title>nothing to see here</title>
     <style type="text/css">
          .tabOne {
               text-indent: 40pt;
          }
     </style>
</head>

<body>
<p class="tabOne">
     Here is a paragraph with one tab<br>
     on the leading line. Every subsequent<br>
     line is leftmost.
</p>
</body>
</html>
----------

Change the pt size to suit your tastes (can also be px, em, ex, or %).

-corey
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6337434
The one problem I see with this is that if you're just using it to indent the first line of a paragraph it's unnecessary -- there's space after a paragraph by default, and the typography standard is either first line indent OR space after... even for print. ;-)

CSS would work, provided the browser supports that attribute. Some don't, and you can get some strange things happening in older browsers that don't have good CSS support.

If you're using it to align multiple columns, use a table. Not that the pre tag won't work, mind you. And if you're getting this text from a file that doesn't translate well into tables, pre is the easiest way to go -- in theory it would be better to put it into tables, but if you've got 20 pages of data from a report and some of the cells are multi-line entries but the data is in txt format and there are returns between them... pre works just fine. At least you can get the page done in this lifetime.. (I live in the real world too) ;-)
0
 
LVL 4

Author Comment

by:prashant_n_mhatre
ID: 6337446
Thank you all. Yeah...CSS seems to be a better idea.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question