I have a PHP page and I want to indent text is there a way??

I have put the spacer.gif for somelines. But if I put the spacer.gif where I ask for input it comes up miss-algin?


<tr><td><p>Tribute Information</p></td></tr>

<tr><td><img src=Images/spacer.gif width=35>To someone special:</td></tr>


<tr><td valign=middle><p>Name: </p></td><td colspan=5 valign=middle height=30><p><input type=text name=tname size=20 maxlength=30></p></td></tr>


Thanks for any help
newbie to php

This seems like more of an html question than php. Have you tried using the non-breaking space ( &nbsp; )? Two of these characters should give a reasonable indent (or four if you need something wider).

However, I have no idea which context you are trying to indent in, so I can't offer any advanced suggestions.

I have a iframe php code for the form
I am at: https://www.turnstone.org/donateprocessing.html

I am having a rough time with keeping it align good.
I am trying your suggestion of &nbsp; does this code below look like how you would do it?


<tr><td valign=middle><p>&nbsp;Name: </p></td><td colspan=5 valign=middle height=30><p><input type=text name=tname size=20 maxlength=30></p></td></tr>


Thx Russ

Aha, forms. II'm sorry but when I do forms I just get lazy and make all the text boxes the same size, and then either place them all on the left (instead of right), or underneath their labels.

Smart guy..
I have it started this way and reviewed by the client already so I have to roll with the punchs.
Russ

ahhh, tables ... useful for form layout, I admit.

I probably wouldn't use a spacer image for formatting, but if you do and are building the page with PHP remember that the image needs to be in relation to the page being displayed and not relative to the PHP adding content to that page (unless it is inline PHP then they are the same page).

Another possible work around is aligning your left-column content to the right, and your right-column content to the left -- that way they look (are) lined up and it's easier to read the label for the form field. Just a thought.

Looking at your page as I write this, it looks pretty lined up to me in FF3

Good luck

ahhh, tables ... useful for form layout, I admit.

I probably wouldn't use a spacer image for formatting, but if you do and are building the page with PHP remember that the image needs to be in relation to the page being displayed and not relative to the PHP adding content to that page (unless it is inline PHP then they are the same page).

Another possible work around is aligning your left-column content to the right, and your right-column content to the left -- that way they look (are) lined up and it's easier to read the label for the form field. Just a thought.

Looking at your page as I write this, it looks pretty lined up to me in FF3

Good luck

Thanks for your help:
If you see the page:
https://couragecenter.us/NETCOMMUNITY/SSLPage.aspx?pid=206
I am to make my page at: https://www.turnstone.org/donateprocessing.html
look similiar. I have the font size changing on me at the bottom when I do not want it to?
Russ

The page you are making still looks lined up in both FF3 and IE7 on Windows. The font size problem you speak of is, I believe, a stylesheet problem. Most of the text is in Arial (maybe Verdana) but the last bit lapses into Times (maybe Times New Roman). Find what hooks (element name <p>, class, etc) the CSS stylesheet is using and make sure all elements on the page have those hooks. Or an easier approach is to style the page one way body{font-family:Arial;} and selectively make changes for elements you want styled a different way h1{font-family:Verdana;} .

The page you are copying uses the idea of aligning the left-column text to the right, like I suggested in my earlier post... that is then what you want to do. And for indent spacing, just make the left column width as wide as you need the formatted spacing to be.

Hope this helps

This article has been dead for over six months. Start a new discussion instead.