Click to See Complete Forum and Search --> : newb question about spacing with  


decibel
03-07-2005, 05:11 PM
Hello there. I space out items in html using several  
The reason i do this is to make my form on the html page look like an existing printed form. My question is there an easier way to space stuff , thanks.

example:

<?php
echo "
7. INSURED'S ADDRESS (No. Street)<br>
<input type='text' name='subadd' size='30' value='".$subadd."'>
</td>
</tr>
<tr>
<td class='redtext'>CITY &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;
STATE<br>";
?>

Black_Kasanova
03-07-2005, 07:30 PM
You may use the <spacer> tag. simply if you wanna add 100 pixels of space it'll come out like this:
<spacer type="horizontal" size="100">.

notice: this way is not reliable some times, so i advise placing an entirely transparent-1x1px. image, this must look like: <img src="MyTransparentImage.gif" width="100">

decibel
03-07-2005, 08:10 PM
thanks dude, i'll try the <spacer> tag, as far as the img goes, there are many times that i need to do this, so i dont really want to create a spacer that big.

phpnovice
03-08-2005, 08:54 AM
Originally posted by decibel
...as far as the img goes, there are many times that i need to do this, so i dont really want to create a spacer that big.
You don't create it "that big". You create a one pixel by one pixel transparent GIF image and use that as your spacer no matter how large the area is that you need to space out. The width and height are specified at design time and the 1x1 GIF image just gets stretched to match your specifications.

NogDog
03-08-2005, 09:26 AM
The better solution is to use CSS styling. Via the selective use of CSS margin, padding, and positioning options you can accomplish the same effects, generally with less code, and often with more precision; plus you then keep your layout code separate from your content code (with the benefit of making it simpler to change the look without having to change the content of the page).

toicontien
03-08-2005, 10:50 AM
Besides, &amp;nbsp; is meant to provide spaces between inline elements when you don't want them to text-wrap to another line. The "nbsp" stands for Non-Breaking SPace.

For example: "Doesn't&amp;nbsp;wrap" will not wrap to another line between the words "Doesn't" and "wrap," even though a space appears. "Doesn't wrap" will wrap to another line between "Doesn't" and "wrap."

It's HTML's version of the CSS property and value: white-space: nowrap;

decibel
03-08-2005, 07:46 PM
well i appreciate all the feedback, and i thank you toicontien, i've long wondered how to stop that from happening.

toicontien
03-09-2005, 01:30 PM
Actually, the proper way to prevent text from wrapping is applying this CSS property: white-space: nowrap;

If you need help with that, just visit us in the CSS forum.