Forum Moderators: open

Message Too Old, No Replies

Is there something I am missing?

I really need some extra eyes to look over this simple HTML...

         

Conscientious Reject

12:42 am on Nov 13, 2005 (gmt 0)

10+ Year Member



This code seems easy enough, but there is something wrong. In the last table cell I am looking for a attribute width=75. But when I add it in, it gives far too much of a width. I even tried the cell up one row. Can someone see something I can't.

<table width=600 height="100%" border=0 cellspacing=0 cellpadding=0>
<tr>

<td background= bgcolor="green" height=122 width=74 ></td>
<td colspan=2>
<table height="100%" width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td bgcolor="red" height=70></td><td bgcolor="blue" width=227

rowspan=2></td>
</tr>
<tr>
<td bgcolor="purple">HEADER HERE!</td>
</tr>
</table>
</td>

</tr>
<tr>

<td bgcolor="brown"></td><td bgcolor="maroon"></td><td bgcolor="cyan"

></td>

</tr>
<tr>

<td bgcolor="red" height=43></td><td bgcolor="lime" ></td><comment>here is the problem child.<td bgcolor="white"></td>
</tr>
</table>

Conscientious Reject

12:52 am on Nov 13, 2005 (gmt 0)

10+ Year Member



Just so everyone knows, that comment isn't even isn't part of the real code. So let's pretend that I remembered the closing tag. Also, try adding the attribute width to the last <td bgcolor="white"> and you will see what I mean.
Thanks

Warren Contreras

6:02 pm on Nov 13, 2005 (gmt 0)

10+ Year Member



Not sure what effect you are trying for but nesting tables is just a matter of correct math getting all the widths to agree.

However, your first line has background= bgcolor="green" and should use one or the other but not both.

serverrealty

6:22 pm on Nov 13, 2005 (gmt 0)

10+ Year Member



my method to get html to work is this:

1. start it
2. save it
3. view it in 2 or 3 browsers
4. fix it
5. go back to step 2 and repeat til finished

It is the only way. I have edited files 500+ times to completion.

Good Luck

tbear

12:48 am on Nov 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sometimes, adding 1px border helps sort out what is happening....

Marcia

1:19 am on Nov 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First row of main table:

<table width=600 height="100%" border=0 cellspacing=0 cellpadding=0>
<tr>

<td background= bgcolor="green" height=122 width=74 ></td>
<td colspan=2>

So for the top row, the first td is one column and the second is 2 columns?

1 + 2 = 3 columns, the first row is 3 columns wide

Bottom row of main table:

<tr>
<td bgcolor="red" height=43></td><td bgcolor="lime" ></td><comment>here is the problem child.<td bgcolor="white"></td>
</tr>

And the bottom row is, first td = 1 column and second td = 1 column

1 + 1 = columns, the bottom row is 2 columns wide

The easiest way to test nested tables is to use a 1 pixel border around each of them, each one in a bright, vivid color. When there's a discrepancy, it won't look right when viewing in browser.

Conscientious Reject

8:21 am on Nov 14, 2005 (gmt 0)

10+ Year Member



Well, I figured it out, but it still does not make sense, it seems:

... Without content to dictate the size of some cells, it seems that the cellpadding attribute can really hinder performance. Not to say it's not a great attribute, I just had to nest tables into an entire row, instead of particular cells. Also, when your using a percentage length for a table, and point lengths for all of it's cells can be dangerous as well. But not until your nesting a whole lot of tables.

Thanks