Table within a table - white space?

Hey guys, I’ve got a table within a table. Below shows the bit I’m having trouble with. In one col of the table echo out some text. but when I instert another table its seems like there are 5-6 <BR> in there. I chucked in echo “a”; which appear right where I want the 2nd table. Am i missing some atribute? i’ve tried valign with no luck…

Any Ideas? Thanks for looking.


echo "<table width=\\"680\\" border=\\"0\\" align=\\"center\\" cellpadding=\\"1\\" cellspacing=\\"1\\">";
echo "<tr>";
echo "<td width=\\"400\\" align=\\"left\\" valign=\\"top\\"><h1>$row[2] Worktop</h1>";
echo "<h2>$row[1] $row[2] Worktop</h2>";
echo "<p><b>Texture :</b> $row[3]</p>";
echo "$row[2] is available in the following sizes :-";
echo "a";

echo '<table border="1" valign="top" CELLSPACING=0 CELLPADDING=0>
<tr>
<td width="190">Worktop Size</td>
<td width="60">Price</td>
<td width="30">Quantity</td>

When you enter a second table within the cell of an existing table (nesting), that cell will expand to contain the second table, so yes the cell with the “a” in will get a lot bigger.

Is there no other way than nesting tables, cant you get the layout you require using CSS and a div for your nested table ?

well theres a lot to be recoded if I do it that way. I just dont get why there is space between the text and my second table. I added border to show you here.

Is the site online, can you send me a link

Here is my test page. I’ve made the borders visable so you can see what i mean.

http://www.worktopmagic.co.uk/omega1-19/Strass-Noir.php

It looks as if you have some html markup issues there, they could be causing the probem. Check your html for errors.

Also the page doesnt look good in IE8, where the picture is pushed to the bottom of the page.

I’ll have a closer look see if theres anything else

There is a problem with your form, you only have one form but you are declaring it twice.

Also the markup for the order table is all over the place, you have <tr> tags with no </tr> as well as some form options are not in speech marks ie

<input type="hidden" name="row-omega5" value=Omega>

should be

<input type="hidden" name="row-omega5" value="Omega" />

Then (eventually :smiley: ) we get to the root of your problem, you have <br> tags in no-mans land within the order table, because these are not within <td></td> tags the table puts them at the top, and that is pushing your table down.

By the way all <br> tags should be <br /> all inputs should also end with a closing tag.

Hi Mandes, Thanks for that I will get to work on it straight away