Jump to content

Table Won't End!


jarrett000

Recommended Posts

Here's my code:

<html><body><table class="miantable" width="100%"> <tbody><tr><td><?phpif (isset($_GET['post])) {echo "Thank You.";}else {echo "<form><input name="post" /></form>";}</td></tr></tbody></table><table width="50%" style="margin-right:auto;margin-left:auto;"> <tbody><tr><td><a href="/">Home</a></td></tr></tbody></table></body></html>

Theres the entire code. My problem is that the second table is for some reason within the first one although I closed it. Does anyone know why it may do this?

Link to comment
Share on other sites

Where is it in your corrected page? It should be immediately following the 'else' clause.
else {echo "<form><input name="post" /></form>";}?>

Yes, Your code is exactly where mine is. The corrected string of code is:
<html><body><table class="miantable" width="100%"><tbody><tr><td><?phpif (isset($_GET['post'])) {echo "Thank You.";}else {echo "<form><input name='post' /></form>";}?></td></tr></tbody></table><table width="50%" style="margin-right:auto;margin-left:auto;"><tbody><tr><td><a href="/">Home</a></td></tr></tbody></table></body></html>

Which, consequently, does nothing different (there was one correction made to the php one ['post']).

Link to comment
Share on other sites

<html><body><table class="miantable" style="border: 1px solid red;" width="100%"><tbody><tr><td><?phpif (isset($_GET['post'])) {echo "Thank You.";}else {echo "<form><input name='post' /></form>";}?></td></tr></tbody></table><table width="50%" style=" border: 1px solid red; margin-right:auto;margin-left:auto;"><tbody><tr><td><a href="/">Home</a></td></tr></tbody></table></body></html>

I added some borders so show the outline of the separate tables.Works for me, but it might not be exactly what you expected. Not sure.Adding a valid Doctype might be a good idea, and for the simplicity of this Form, try using a css only layout.

Link to comment
Share on other sites

Nice try, but that does give it borders, although it's still within the first table (including the border on the second table) which makes it look like just box at the bottom of the table. That's kinda ugly if you were to see the page, and not only that but my intention for the footer is to be separated utterly from the first table with images at the sides to seem as if it has rounded sides. Considering that your solution simply doesn't work but thanks for trying.

Link to comment
Share on other sites

Which Browser are you using?Firefox 3 shows the top table as full width and the second table as a centred 50% width table directly under it. (outside the first table)Want a screenie?*edit*Add this Doctype to the top of your page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Above the html tag.

Link to comment
Share on other sites

I have that doctype currently, however, it has no effect on the problem at hand. I've tried transitional and frameset too but they just screw up the page. As for my browser I've tried it in firefox 3, ie6 & 7, google chrome, avant, phaseout, and opera all in their latest versions.

Link to comment
Share on other sites

The 2nd table isn't within the 1st one for me, it's centered under it just as jlhaslip said.Maybe you mean that the borders overlay ? If so just add margins.And btw, you should use divs rather than tables for your layout, leave tables for tabular datas.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...