Strange Table Problem

liunx

Guest
I've been banging my head against this problem for over an hour now, and I'm struggling to see what the problem is, let alone a solution. <br />
<br />
The problem seems to be related to the 'Main Title Graphic' code, specifically the colspan property.<br />
<br />
If you change the colspan property to 1 (and shrink\remove the title graphic since it will no longer fit in the cell) everything works perfectly. <br />
<br />
<br />
<td class="bgcolor-white" rowspan="2" colspan="4" valign="top"><br />
<!-- Main Title Graphics, width shrunk to 100 --><br />
<img src=http://www.htmlforums.com/archive/index.php/"main_title.jpg" align="left" height="100" width="100" hspace="0" vspace="0"><br />
</td><br />
<br />
<br />
But as soon as colspan is set to 4 to stretch it across the page everything brakes down.<br />
<br />
Thanks for the help...and for not laughing at me if the solution is too simple ;)<!--content-->When you are using colspan and rowspan more then twice in a table it is not easy to find out what is wrong.<br />
Creating a page always use border="10" in a table, so you can see what you are doing.<br />
If it is ok border="0"<br />
<br />
I took out this part<br />
<colgroup colspan="6"><br />
<col width="30"><br />
<col width="90"><br />
<col width="30"><br />
<col width="30"><br />
<col width="540"><br />
<col width="30"><br />
</colgroup><br />
and it looks better.<br />
<br />
In the att the borders are on 10.<br />
<br />
Or:<br />
use one table to contain the toplogo<br />
and one to contain the content.<br />
Both same width and align="center"<br />
<br />
<br />
:rocker:<!--content-->Thanks for the tip about the border, most helpful. <br />
<br />
Unfortunately colgroup brakes all the border sizes, and the same problem occurs if I set the cell sizes separately.<br />
<br />
The simple solutiom would be just to use two tables, but I shouldn't have too. The code seems fine (and I've gone through it line-by-line atleast 10 times). <br />
<br />
Very frustrating.<!--content-->ok for one, you need to have your table cells all 1 line<br />
<br />
<td class="bgcolor-green"><br />
<p class="menu">Menu Item</p><br />
</td><br />
<br />
not good that way. need it like this<br />
<br />
<td class="bgcolor-green"><p class="menu">Menu Item</p></td><br />
<br />
also it would be as lot better if you had the image for us as well. it ia hard to picture what you want without them.<br />
<br />
because I personally don't see the problem.<br />
<br />
<tr><br />
<td class="bgcolor-white" valign="top"><!-- Main Title Top-Left Corner --><img src=http://www.htmlforums.com/archive/index.php/"white_corner_tl.jpg" align="left" height="30" width="30" hspace="0" vspace="0"></td><br />
<br />
<td class="bgcolor-white" rowspan="2" colspan="4" valign="top"><br />
<!-- Main Title Graphics --><br />
<img src=http://www.htmlforums.com/archive/index.php/"main_title.jpg" align="left" height="100" width="690" hspace="0" vspace="0"><br />
</td><br />
<br />
<td class="bgcolor-white" valign="top"><br />
<!-- Main Title Top-Right Corner --><br />
<img src=http://www.htmlforums.com/archive/index.php/"white_corner_tr.jpg" align="right" height="30" width="30" hspace="0" vspace="0"><br />
</td><br />
<br />
</tr><br />
<br />
there is your first row. why use rowspan on something that isn't there? there isn't anything to span.<!--content-->why use rowspan on something that isn't there? there isn't anything to span. <br />
<br />
Stupidly enough, that was the problem. <br />
<br />
Here (<!-- m --><a class="postlink" href="http://www.angelfire.com/ab7/whatson/site/index.htm">http://www.angelfire.com/ab7/whatson/site/index.htm</a><!-- m -->) is an example of what the page is supposed to look like. <br />
<br />
The problem was that I needed 6 rows for the design, but because of my rowspan\colspan set-up I only ended up having 4. Hence, everything brakes. <br />
<br />
To fix this I just placed a row with 6 columns across the bottom (There along the top in the above example, and are used to mark out where each colmn starts). <br />
<br />
Not the ideal solution, but I'm can't think of any other way around it. <br />
<br />
Slightly OT: Why place your table cells all on one line? It is easier to read if you split them up.<!--content-->>> Why place your table cells all on one line? It is easier to read if you split them up. <<<br />
<br />
Code that has the <td> stuff spread over several lines of code often seems to have some odd extra 1-pixel spaces between the elements inside that cell, or other such sizing, padding and border problems, in some browsers.<!--content-->Originally posted by Morgoth <br />
Stupidly enough, that was the problem. <br />
<br />
Here (<!-- m --><a class="postlink" href="http://www.angelfire.com/ab7/whatson/site/index.htm">http://www.angelfire.com/ab7/whatson/site/index.htm</a><!-- m -->) is an example of what the page is supposed to look like. <br />
<br />
The problem was that I needed 6 rows for the design, but because of my rowspan\colspan set-up I only ended up having 4. Hence, everything brakes. <br />
<br />
To fix this I just placed a row with 6 columns across the bottom (There along the top in the above example, and are used to mark out where each colmn starts). <br />
<br />
Not the ideal solution, but I'm can't think of any other way around it. <br />
<br />
Slightly OT: Why place your table cells all on one line? It is easier to read if you split them up. <br />
why do that? just take the rowspan out and the colgroups out.<!--content-->What do you mean? If I removed the colspan in the title it wouldn't stretch past the borders, and if I removed the colgroups, all the dimensions would be off. <br />
<br />
What am I missing? :confused:<!--content-->you don't need colgroups to do a table. you can set the size in the cell itself. just have to work at it.<!--content-->But even if you set the width of the cells individually, all the cells in a row have to be the same width, don't they?<!--content-->as long as all the cells equal up to 100% of the total width of the users resolution then they can be any size you want.<!--content-->Hmmm, I'm using a table width="750"...Is it possible if your specifying a width?<!--content-->if you don't use a width like that then it will go by the users resolution. if you do use a set width then it has to be that big.<!--content-->I can't seem to create a table without having the rows share cell widths. <br />
<br />
Do you have an example of this?<!--content-->what do you mean? you don't know how to do a simple table?<br />
<br />
<br />
<table width="100%><br />
<tr><br />
<td width="50%">&nbsp;</td><br />
<td width="50%">&nbsp;</td><br />
</tr><br />
</table><br />
<br />
that is each cell will take half the page.<!--content-->Yes, that makes sense and works properly, but if you do something like this: <br />
<br />
<br />
<table border="1" width="100%"><br />
<tr><br />
<td width="25%">&nbsp;</td><br />
<td width="50%">&nbsp;</td><br />
<td width="25%">&nbsp;</td><br />
</tr><br />
<br />
<tr><br />
<td width="100%">&nbsp;</td><br />
</tr><br />
</table><br />
<br />
<br />
The system breaks down some.<!--content-->I only said to get rid of rowspan NOT colspan. you have to use colspan on the last row if you want that row to fill 3 cells.<br />
<br />
<br />
<table border="1" width="100%"><br />
<tr><br />
<td width="25%">&nbsp;</td><br />
<td width="50%">&nbsp;</td><br />
<td width="25%">&nbsp;</td><br />
</tr><br />
<br />
<tr><br />
<td width="100%" colspan="3"> </td><br />
</tr><br />
</table><!--content-->Ah, yes, so you did. My mistake. <br />
<br />
Excuse my persistence in not following the play, but how would you create a table like this:<br />
<br />
<br />
<table border="1" width="100%"><br />
<tr><br />
<td width="10%">&nbsp;</td><br />
<br />
<td width="80%" rowspan="2">&nbsp;</td><br />
<br />
<td width="10%">&nbsp;</td><br />
</tr><br />
<br />
<tr><br />
<td width="10%">&nbsp;</td><br />
<br />
<td width="10%">&nbsp;</td><br />
</tr><br />
</table><br />
<br />
<br />
...without using rowspan? If I can't use rowspan itself, I need an alternative to use for my borders and menu.<!--content-->well if you don't use 2 table (nested tables) then you dno't have a choice to use rowspan. nothing wrong with it the way you are using it but the other way was.<!--content-->Ok, I think I get you....<br />
<br />
Going back to the original design, I want to do something like this (<!-- m --><a class="postlink" href="http://www.htmlforums.com/attachment.php?s=&postid=129987">http://www.htmlforums.com/attachment.ph ... tid=129987</a><!-- m -->) ?<br />
<br />
(I kept the the colgroups, since I prefere them to setting cell widths individually.)<!--content-->
 
Back
Top