Space: the Final Frontier

One of the sillier things in the HTML standard is that there just isn't a well-thought out way to put space where you want it. Netscape has a tag called <spacer> which can insert horizontal or vertical space, but it is decidedly not accepted by the W3C so you'd better forget about it.


        This is a special character . . .

        This is a special character . . .

        This is a special character . . .

        This is a special character--all special characters can be represented by &amp;[number]; and the important ones have names. &nbsp; means "non-breaking space." It's purpose as designed was to allow you to put a space between two words but have them remain on the same line even if word-wrapping wanted to break them up. But it is usually put in simply to put in more than one space, and leads to the monstrosity that produced the indent in this paragraph:

This is a special character . . .

Now there were seven of them in a row to produce an eight-space indentation. Are you confused yet? The eighth space was provided by the end of the line. It could also be done like this:

<p>&nbsp; &nbsp; &nbsp; &nbsp;
This is a special character . . .

Or like this:

<p>&nbsp; &nbsp; &nbsp; &nbsp; This is a special character . . .

Paul Lutus has to put in &nbsp;s so often he put a special shortcut key for it in Arachnophilia: <Ctrl><Spacebar>.

Another cludge to produce a paragraph indent I've seen done is this one: Put a transparent GIF at the beginning of each paragraph. I'm using the width attribute to stretch mine, but usually it seems to be done with a natural-size GIF, which makes for less coding but more time to load. This is how it was done at the beginning of this paragraph:

<p><img src=../../images/transparent.gif width=50 height=1>Another cludge to

With the exception of text set off by the <pre> tag (and some other tags you can look up but probably don't need to bother with because you will probably never see them), any white space between characters is interpreted this way by every browser I've seen:

A future standard of HTML is supposed to have three new and different space characters (different widths) but it's just a proposal that may or may not be acted on by browser writers. And it doesn't do anything about making reliable vertical spacing in a simple, consistent way.

Anyway, if you look at the code produced by some page builders, you will see a cat's cradle of tables inside tables inside tables, all mostly with cells with "blank.gif" or somesuch. This is just a giant cludge to put things on the screen exactly where you want them using the technique I used to build a mostly-blank box high enough to keep the adsquare out of harm's way. Maybe. But not in all browsers, of course. To quote garouwyrm: "AAAAARRRRRRRGGGGGHHHH!"

Back to HTML Tables
HTML Index Main Index
Hosting by WebRing.