Easy table question

admin

Administrator
Staff member
hiall :) i got this stupid problem, i hope it can be solved :S<br />
<br />
<TABLE BORDER=3 VALIGN=top><br />
<TR><br />
<TD ROWSPAN=2 width=50><br />
This cell is the one that determines the height of<br />
the whole table!<br />
</TD><br />
<TD width=200>I dont want this cell to stretch</TD><br />
<tr><br />
<td>but i want this one to..</td><br />
</TABLE><br />
<br />
when using rowspan it tends to stretch all cells, even if one<br />
has ha defined height and the other one doesnt it will eventually<br />
stretch both :(<br />
<br />
thx in advance, banan :)<!--content-->First of all, your coding is a little bit confused. Try the order below.<br />
<br />
<table border="3" valign="top"><br />
<tr><br />
<td rowspan="2" width="50"><br />
This cell is the one that determines the height of<br />
the whole table!<br />
</td><br />
<td width="200">I dont want this cell to stretch</td><br />
<td>but i want this one to..</td><br />
</tr><br />
</table><br />
<br />
Secondly, I am not sure what you mean by "stretch". The one you don't want to stretch is 200 wide and the one you want ot stretch has no width listed.<br />
<br />
Lee<!--content-->thx, but its supposed to be two levels like this:<br />
____<br />
| |_|<br />
|_|_|<br />
<br />
sorry, ill try to explain better; i meant stretching the height.<br />
right now if the cell wich has rowspan=2 gets larger<br />
the table will look like this:<br />
___<br />
| | |<br />
| |_|<br />
| | |<br />
|_|_|<br />
<br />
ie, both of the small cells are "stretched" vertically, but i only want one of them to, like this:<br />
___<br />
| |_|<br />
| | |<br />
| | |<br />
|_|_|<br />
<br />
hope this clarifies :S<!--content-->Why not just put another table within the existing one with the dimensions you need?<!--content-->Originally posted by banan <br />
thx, but its supposed to be two levels like this:<br />
____<br />
| |_|<br />
|_|_|<br />
<br />
sorry, ill try to explain better; i meant stretching the height.<br />
right now if the cell wich has rowspan=2 gets larger<br />
the table will look like this:<br />
___<br />
| | |<br />
| |_|<br />
| | |<br />
|_|_|<br />
<br />
ie, both of the small cells are "stretched" vertically, but i only want one of them to, like this:<br />
___<br />
| |_|<br />
| | |<br />
| | |<br />
|_|_|<br />
<br />
hope this clarifies :S <br />
<br />
I think that if you count them really carefully, you'll discover there are two rows in your illustration, and only one in your code...<br />
<br />
<br />
So make a table 2 x 2. Merge/span vertically to get on long column on the left. Then start putting stuff in your cells. <br />
Hint <tr> = row, <td> = a cell in a row. Think about colspan perhaps, not rowspan.<!--content-->uh, is it??<br />
anyway, leeU is right :D how stupid of me, it works fine now, thx :D<!--content-->leeU is right <br />
No, he's not. Nesting tables is bad practice and should be avoided if better alternatives are available.<br />
You haven't been totally clear on the desired table layout, but I'm sure it can fairly easily be achieved.<br />
<br />
A basic, two-row table with three cells, one spanning both rows:<br />
<table><br />
<tr><br />
<td rowspan="2">a</td><br />
<td>b</td><br />
</tr><br />
<tr><br />
<td>c</td><br />
</tr><br />
</table><br />
Remember: cell "a" is actually part of the first row, but since it spans both rows, the second row only contains one cell.<!--content-->Originally posted by ronaldb66 <br />
You haven't been totally clear on the desired table layout, but I'm sure it can fairly easily be achieved.<br />
<br />
I'm sorry, my english isn't as good as i wish it was.<br />
<br />
Your code doesn't differ from mine though, the whole thing is that<br />
if cell A gets higher (if it's filled with some content) then<br />
of course the whole table will be/get higher.<br />
Cell A will be "stretched" and cell B and C will be stretched<br />
to 50% each of the total height, right?<br />
<br />
BUT, i only want ONE of the cells (B or C) to stretch together with cell A. So; cell A will (obviously) stretch 100%, cell B will be as high as it used to be and cell C will be X % (remaining hight of the entire table; that is of course: 100% -B's %).<br />
<br />
Hope this makes is easier to understand. Thanks :)<!--content-->
 
Back
Top