By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,244 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,244 IT Pros & Developers. It's quick & easy.

How do I control heights of cells next to a ROWSPANned cell?

P: n/a
Suppose I make a table that looks like

---------
| A | |
|---| |
| B | D |
|---| |
| C | |
---------

What I'd like to do is to have cells A and B only be as high as they
need to be based on their contents, and cell C to take up the remainder
of the vertical space. Can someone tell me how to do this?

Please reply by e-mail as well as posting, if possible.

TIA,
-Lotofun
Jul 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Lot-o-fun wrote:
Suppose I make a table that looks like

---------
A | |
---| |
B | D |
---| |
C | |

---------

What I'd like to do is to have cells A and B only be as high as they
need to be based on their contents, and cell C to take up the
remainder of the vertical space. Can someone tell me how to do this?

Please reply by e-mail as well as posting, if possible.

TIA,
-Lotofun


Make the height of the third cell 100%. Won't take up 100% of the browser
window, will take up 100% of the available space.
Jul 20 '05 #2

P: n/a
Lot-o-fun wrote:
Suppose I make a table that looks like

---------
| A | |
|---| |
| B | D |
|---| |
| C | |
---------

What I'd like to do is to have cells A and B only be as high as they
need to be based on their contents, and cell C to take up the remainder
of the vertical space. Can someone tell me how to do this?

Please reply by e-mail as well as posting, if possible.

TIA,
-Lotofun


<html>
<body>
<table width="100%" height="100%" border="1">
<tr>
<td width="20%" height="100">A</td>
<td width="*" height="100%" rowspan="3">D</td>
</tr>

<tr>
<td width="20%" height="100">B</td>
</tr>

<tr>
<td width="20%" height="*">C</td>

</tr>
</table>
</body>
</html>
change as needed
Jul 20 '05 #3

P: n/a
Weyoun the gowd damn Dominion Vorta who certainly didn't dance
<bl**@blah.blah> wrote:
<table width="100%" height="100%" border="1">
Height is not a valid attribute of table.
<td width="*" height="100%" rowspan="3">D</td>
* is not a valid value for width in this context. Only when used on
the col and colgroup elements may * be used in the width attribute.
<td width="20%" height="*">C</td>


* is not a valid value for height.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4

P: n/a
Steve Pugh wrote:
Weyoun the gowd damn Dominion Vorta who certainly didn't dance
<bl**@blah.blah> wrote:

<table width="100%" height="100%" border="1">

Height is not a valid attribute of table.

<td width="*" height="100%" rowspan="3">D</td>

* is not a valid value for width in this context. Only when used on
the col and colgroup elements may * be used in the width attribute.

<td width="20%" height="*">C</td>

* is not a valid value for height.


?

It works in IE6 and FireFox? Is it not valid? If not, what's the proper
coding to do a wildcard-type value? I wonder....

<tries something>
<html>
<body>
<table width="100%" height="100%" border="1">
<tr>
<td width="20%" height="100">A</td>
<td height="100%" rowspan="3">D</td>
</tr>

<tr>
<td width="20%" height="100">B</td>
</tr>

<tr>
<td width="20%">C</td>
</tr>
</table>
</body>
</html>

Ah ha!
Of course, the default is "*" anyway (or at least "undefined") so the
browser calculates it automatically.
Jul 20 '05 #5

P: n/a
Steve Pugh wrote:
<table width="100%" height="100%" border="1">

Height is not a valid attribute of table.


well... then how do you define the table's height? (without CSS?)

You're right though, I just rechecked the specs and it's not listed and
my pocket guide HTML book has "height" listed as "nonstandard".

Jul 20 '05 #6

P: n/a
On Thu, 01 Apr 2004 14:48:37 +0100, Weyoun the gowd damn Dominion Vorta
who certainly didn't dance <bl**@blah.blah> wrote:
Steve Pugh wrote:
<table width="100%" height="100%" border="1">

Height is not a valid attribute of table.


well... then how do you define the table's height? (without CSS?)


You don't :)

Browsers are expected by authors to perform some magic to make things look
like they want, without any specification about how nested tables, widths
that don't add up 100% and the relation with the viewport are to be
handled.

CSS does have such rules on how (percentage) heigths are supposed to work,
but browsers should forget most of them when handling tables...

--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won't get any real work done. - J.Nielsen
Jul 20 '05 #7

P: n/a
I hate working in percent.. i like pixels better.. but percent has its
advantages

Later,
Keeper
"Weyoun the gowd damn Dominion Vorta who certainly didn't dance"
<bl**@blah.blah> wrote in message news:iAUac.1716$4N3.950@newsfe1-win...
Lot-o-fun wrote:
Suppose I make a table that looks like

---------
| A | |
|---| |
| B | D |
|---| |
| C | |
---------

What I'd like to do is to have cells A and B only be as high as they
need to be based on their contents, and cell C to take up the remainder
of the vertical space. Can someone tell me how to do this?

Please reply by e-mail as well as posting, if possible.

TIA,
-Lotofun


<html>
<body>
<table width="100%" height="100%" border="1">
<tr>
<td width="20%" height="100">A</td>
<td width="*" height="100%" rowspan="3">D</td>
</tr>

<tr>
<td width="20%" height="100">B</td>
</tr>

<tr>
<td width="20%" height="*">C</td>

</tr>
</table>
</body>
</html>
change as needed

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.669 / Virus Database: 431 - Release Date: 4/26/04
Jul 20 '05 #8

P: n/a
lol ..

IE has always auto maticly done that.. but watch.. netscape might look
retarded.

BTW: not defining a cell size defaults to 10px

However!!!!!\

<Table width="40" Height="40" border="1" cellpadding="1" cellspacing="1"
bordercolordark="#006699" bordercolorlight="#009999">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

That code will auto set each cell to 20px X 20px.. coding with undefinded
height and width.. can cause probs.. i recomend adjusting each TR height..
for content in pixels or percent.. i use pixels.. but whitch ever you are
comfortable with.

Later,
Keeper

"Weyoun the gowd damn Dominion Vorta who certainly didn't dance"
<bl**@blah.blah> wrote in message
news:QZ**************@newsfe3-win.server.ntli.net...
Steve Pugh wrote:
Weyoun the gowd damn Dominion Vorta who certainly didn't dance
<bl**@blah.blah> wrote:

<table width="100%" height="100%" border="1">

Height is not a valid attribute of table.

<td width="*" height="100%" rowspan="3">D</td>

* is not a valid value for width in this context. Only when used on
the col and colgroup elements may * be used in the width attribute.

<td width="20%" height="*">C</td>

* is not a valid value for height.


?

It works in IE6 and FireFox? Is it not valid? If not, what's the proper
coding to do a wildcard-type value? I wonder....

<tries something>
<html>
<body>
<table width="100%" height="100%" border="1">
<tr>
<td width="20%" height="100">A</td>
<td height="100%" rowspan="3">D</td>
</tr>

<tr>
<td width="20%" height="100">B</td>
</tr>

<tr>
<td width="20%">C</td>
</tr>
</table>
</body>
</html>

Ah ha!
Of course, the default is "*" anyway (or at least "undefined") so the
browser calculates it automatically.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.669 / Virus Database: 431 - Release Date: 4/26/04
Jul 20 '05 #9

P: n/a

"Keeper" <en**********@usadatanet.net> wrote in message
news:MK********************@usadatanet.net...
lol ..

IE has always auto maticly done that.. but watch.. netscape might look
retarded.
Please do not give any more advice until you learn what the fuck you're
talking about.
The snippet below is the most disgusting example of know-nothingness I've
seen on this newsgroup in months.

-Karl

BTW: not defining a cell size defaults to 10px

However!!!!!\

<Table width="40" Height="40" border="1" cellpadding="1" cellspacing="1"
bordercolordark="#006699" bordercolorlight="#009999">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

That code will auto set each cell to 20px X 20px.. coding with undefinded
height and width.. can cause probs.. i recomend adjusting each TR height..
for content in pixels or percent.. i use pixels.. but whitch ever you are
comfortable with.

Later,
Keeper

"Weyoun the gowd damn Dominion Vorta who certainly didn't dance"
<bl**@blah.blah> wrote in message
news:QZ**************@newsfe3-win.server.ntli.net...
Steve Pugh wrote:
Weyoun the gowd damn Dominion Vorta who certainly didn't dance
<bl**@blah.blah> wrote:
><table width="100%" height="100%" border="1">
Height is not a valid attribute of table.
><td width="*" height="100%" rowspan="3">D</td>
* is not a valid value for width in this context. Only when used on
the col and colgroup elements may * be used in the width attribute.
><td width="20%" height="*">C</td>
* is not a valid value for height.


?

It works in IE6 and FireFox? Is it not valid? If not, what's the proper
coding to do a wildcard-type value? I wonder....

<tries something>
<html>
<body>
<table width="100%" height="100%" border="1">
<tr>
<td width="20%" height="100">A</td>
<td height="100%" rowspan="3">D</td>
</tr>

<tr>
<td width="20%" height="100">B</td>
</tr>

<tr>
<td width="20%">C</td>
</tr>
</table>
</body>
</html>

Ah ha!
Of course, the default is "*" anyway (or at least "undefined") so the
browser calculates it automatically.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.669 / Virus Database: 431 - Release Date: 4/26/04

Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.