...

View Full Version : Newb Question! Loading .php in Iframe and aligning it in the middle!



PDiddy
02-20-2008, 04:19 AM
All,

I'm trying to load a particular contact form in a .html page. Below is my code snippet. My issue isn't actually loading the .php page as you can see below it does that, however its aligning it in the middle.

This is the code of the .html page loading up the php page:


<html>
<head>
<title>Test Page</title>
</head>


<body >
<table width="600px" height="600px" align="center" border="0">
<iframe frameborder="0" src="contact/form.php" align="center" width="600px" height="600px"> </iframe>
</table>
</body>
</html>

The screenshot is the result of this page where the contact form is all the way on the left. If I am to change the align tag of the iframe to be align="right" then it does move the contact form all the way to the left. Any suggestions? Thanks!

rangana
02-20-2008, 04:24 AM
I'm not taking this right, as the screenshot is vague, anyway have you tried adding style="text-align:center;" in your <iframe> tag. See if it helps :D

PDiddy
02-20-2008, 04:27 AM
Sorry it did not make sense. Let me try again:

There is a top menu which is centered so I want the contact form to be centered. My attachment shows it to be all the way on the left of the browser, even if all the align tags are set to the middle.

What you showed as far as text I did not try because the text align isn't the issue, rather the entire contact form. As mentioned, if I change the align tag to equal 'right' then it does move the contact form all the way to the right of the page. What gives?

rangana
02-20-2008, 04:35 AM
So, the contact form is in the table right??..and you are calling it using <iframe> right?..Then why not add align="center" on the <td> that contains the <iframe>.

There it goes, you don't have the <tr><td> tag, maybe it cause the problem. Try adding a <tr> and <td> tag. See if it helps :D

PDiddy
02-20-2008, 04:45 AM
Hmm, I had no <td> tags but after I added them it seems to work. I wasn't aware that the td tag had to be added, let alone aligned. Thanks!

rangana
02-20-2008, 05:23 AM
You're completely welcome! Glad to help :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum