1. Home
  2. Computing & Technology
  3. Web Design / HTML

Tabs in HTML
Using the Tab Character in Web Pages

By , About.com Guide

Were you looking for help with Tabbed Navigation with HTML?

One of the most confusing things about HTML for a beginning Web designer is the way that white space is handled. In print, the three primary white space characters act in three distinct ways, the space, the tab and the carriage return. But in HTML, browsers render them all exactly the same. If you place 1 space or 100 or mix it up with tabs and carriage returns, they will all be condensed down to 1 space when the page is rendered by the browser.

Then How Do You Get Tabs?

If you're thinking of tabs the way that word processing programs use them, markers along the horizontal axis of the page that text align to, well, the short answer is that you can't. Not exactly.

But typically, when people use tabs in a document, they are using them for layout reasons or to get the text to move over a certain amount. This you can handle in HTML.

Layout

The easiest way to modify layouts in HTML is with CSS. If you're using tabs to create columns of text, you can use div tags that are positioned with CSS to get the same effect. Or if the data is appropriate, you can use tables to align your tabular data as you like.

Moving Text More than One Space

If all you want is for your text to be moved more than one space away from the preceding item, you can use the non-breaking space. To use the non-breaking space, you simply type   as many times as you need it. So if you wanted to space your word 5 spaces over, you would type       and then your word. Note that some really old browsers will still condense non-breaking spaces down to one space, but those browsers are very uncommon now.

Did you find this useful?

You can get more articles and information like this by subscribing to the site newsletter or RSS feed.

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. Intermediate Tutorials
  6. Tabs in HTML: Using the Tab Character in Web Pages>

©2009 About.com, a part of The New York Times Company.

All rights reserved.