HighDots Forums  

A rowspan cell grows - how to get only 1 of the adjacent ones togrow?

alt.html alt.html


Discuss A rowspan cell grows - how to get only 1 of the adjacent ones togrow? in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jarkko Kuoppamäki
 
Posts: n/a

Default A rowspan cell grows - how to get only 1 of the adjacent ones togrow? - 01-12-2008 , 12:52 PM







I have a table consisting of a rowspan=3 cell and three normal size
cells on top of each other, on the left side of the first one. If the
tall one grows (due to its content) vertically let's say double, the
height of other 3 cells double, too. I would need two of those to stay
as they were and the last one to grow 4 times its height. How do I
accomplish this?

I've tried the height parameter of the cell (<td>) or the css defition.
However, this (I believe) defines only the minimum height that will
expand if the contents so require.

The doctype is 4.01 Transitional, but I guess it could be changed if
needed. A solution compatible with all browsers would be ideal, most
browsers sufficient and if nothing else fails, I'd be willing to accept
even a IE-only compatible one.

To illustrate:

<table border=1>
<tr>
<td>cell2</td>
<td rowspan=3><div style="height:300px">cell1</div></td>
</tr>
<td>cell3</td>
</tr>
<td>cell4</td>
</tr>
</table>

thanks in advance,

--Jarkko

Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent ones to grow? - 01-12-2008 , 01:05 PM






Scripsit Jarkko Kuoppamäki:

Quote:
The doctype is 4.01 Transitional,
Why?

Quote:
/tr
td>cell3</td
This isn't valid under any of the HTML doctypes.

Posting a real URL for the real page is often a good start.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #3  
Old   
Jarkko Kuoppamäki
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent onesto grow? - 01-12-2008 , 02:27 PM



Jukka K. Korpela wrote:
Quote:
Scripsit Jarkko Kuoppamäki:

The doctype is 4.01 Transitional,

Why?
This was given with the task, which is to design 'cell1' so that it has
a certain content. This resulted in cells 2-4 growing, which wasn't what
the task assigner had in mind. Since cells 2-4 were given as well, I
would stay out of modifying them (or the doctype) unless it is really
necessary. In a sense, they become my responsibility if I need to edit
them. In theory anyway.

Quote:
/tr
td>cell3</td

This isn't valid under any of the HTML doctypes.

Posting a real URL for the real page is often a good start.
The real URL isn't accessible, but I will see if I could get a copy
published. Meanwhile, let me add the missing <tr>'s (sorry):

<table border=1>
<tr>
<td>cell2</td>
<td rowspan=3><div style="height:300px">cell1</div></td>
</tr>
<tr>
<td>cell3</td>
</tr>
<tr>
<td>cell4</td>
</tr>
</table>

--Jarkko


Reply With Quote
  #4  
Old   
dorayme
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent ones to grow? - 01-12-2008 , 03:28 PM



In article <J%7ij.280098$mT6.42011 (AT) reader1 (DOT) news.saunalahti.fi>,
Jarkko Kuoppamäki
<jarkko.kuoppamaki (AT) gmail (DOT) nospamplease.com.invalid> wrote:

Quote:
I have a table consisting of a rowspan=3 cell and three normal size
cells on top of each other, on the left side of the first one. If the
tall one grows (due to its content) vertically let's say double, the
height of other 3 cells double, too. I would need two of those to stay
as they were and the last one to grow 4 times its height. How do I
accomplish this?

I've tried the height parameter of the cell (<td>) or the css defition.
However, this (I believe) defines only the minimum height that will
expand if the contents so require.

The doctype is 4.01 Transitional, but I guess it could be changed if
needed. A solution compatible with all browsers would be ideal, most
browsers sufficient and if nothing else fails, I'd be willing to accept
even a IE-only compatible one.

To illustrate:

table border=1
tr
td>cell2</td
td rowspan=3><div style="height:300px">cell1</div></td
/tr
tr
td>cell3</td
/tr
td>cell4</td
/tr
/table

Safari 2.0.4 gets you what you want with the above (as long as
cell2 and cell3 have the same "amount" of content). But you might
say more about what you are really doing before anyone here will
try hard to get you as close to what you might be happy with
cross-browser-wise.

--
dorayme


Reply With Quote
  #5  
Old   
Jarkko Kuoppamäki
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent onesto grow? - 01-12-2008 , 03:50 PM



dorayme wrote:
Quote:
In article <J%7ij.280098$mT6.42011 (AT) reader1 (DOT) news.saunalahti.fi>,
Safari 2.0.4 gets you what you want with the above (as long as
cell2 and cell3 have the same "amount" of content). But you might
say more about what you are really doing before anyone here will
try hard to get you as close to what you might be happy with
cross-browser-wise.
I'll see if I can get a copy of the original page available. Meanwhile:
cell1 is dynamic content, and depending on the end user's choices,
displaying it may take space a little (no problem) or more.

There used to be two additional cells on top of cell1, which worked
fine: if cell1 grew, cell4 (on the bottom) next to it grew. However, the
two additional cells were taking space and I was asked to remove them. I
did and now I'm asked why cell2 and cell3 are stretched vertically.

It is starting to look like I need to redesign the left side of the
table, even though they were given as a layout that is used everywhere
else on the site in question.

--Jarkko



Reply With Quote
  #6  
Old   
dorayme
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent ones to grow? - 01-12-2008 , 04:29 PM



In article <3Daij.280200$iD7.84220 (AT) reader1 (DOT) news.saunalahti.fi>,
Jarkko Kuoppamäki
<jarkko.kuoppamaki (AT) gmail (DOT) nospamplease.com.invalid> wrote:

Quote:
dorayme wrote:
In article <J%7ij.280098$mT6.42011 (AT) reader1 (DOT) news.saunalahti.fi>,
Safari 2.0.4 gets you what you want with the above (as long as
cell2 and cell3 have the same "amount" of content). But you might
say more about what you are really doing before anyone here will
try hard to get you as close to what you might be happy with
cross-browser-wise.

I'll see if I can get a copy of the original page available. Meanwhile:
cell1 is dynamic content, and depending on the end user's choices,
displaying it may take space a little (no problem) or more.

There used to be two additional cells on top of cell1, which worked
fine: if cell1 grew, cell4 (on the bottom) next to it grew. However, the
two additional cells were taking space and I was asked to remove them. I
did and now I'm asked why cell2 and cell3 are stretched vertically.

It is starting to look like I need to redesign the left side of the
table, even though they were given as a layout that is used everywhere
else on the site in question.

--Jarkko
Are you noting what I said about browsers? It might be pertinent
at least to mention what browsers you are testing in. It is an
interesting matter how different browsers calculate things
differently.

--
dorayme


Reply With Quote
  #7  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent onesto grow? - 01-13-2008 , 09:01 AM



richard wrote:
Quote:
On Sat, 12 Jan 2008 20:52:27 +0200, Jarkko Kuoppamäki
jarkko.kuoppamaki (AT) gmail (DOT) n...lease.com.invalid> wrote:

I have a table consisting of a rowspan=3 cell and three normal size
cells on top of each other, on the left side of the first one. If the
tall one grows (due to its content) vertically let's say double, the
height of other 3 cells double, too. I would need two of those to stay
as they were and the last one to grow 4 times its height. How do I
accomplish this?

I've tried the height parameter of the cell (<td>) or the css defition.
However, this (I believe) defines only the minimum height that will
expand if the contents so require.

The doctype is 4.01 Transitional, but I guess it could be changed if
needed. A solution compatible with all browsers would be ideal, most
browsers sufficient and if nothing else fails, I'd be willing to accept
even a IE-only compatible one.

To illustrate:

table border=1
tr
td>cell2</td
td rowspan=3><div style="height:300px">cell1</div></td
/tr
td>cell3</td
/tr
td>cell4</td
/tr
/table

One solution might be to use two tables side by side.
That way, the adjacent cell won't react to what the growing cell does.
Unless your table is much more complicated than shown, try using pure
divisions instead of a table format.
Or not use a table at all since it is most likely not tabular data.

The ol' "Why is it so hard to drive nails with this screwdriver" question.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #8  
Old   
Ben C
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent ones to grow? - 01-13-2008 , 04:50 PM



On 2008-01-12, Jarkko Kuoppamäki <jarkko.kuoppamaki (AT) gmail (DOT) nospamplease.com.invalid> wrote:
Quote:
I have a table consisting of a rowspan=3 cell and three normal size
cells on top of each other, on the left side of the first one. If the
tall one grows (due to its content) vertically let's say double, the
height of other 3 cells double, too. I would need two of those to stay
as they were and the last one to grow 4 times its height. How do I
accomplish this?
You can set explicit heights on the cells you want to stay those
heights-- so if you can set the two you want to stay as they were to
some actual height then that might be an option (but see below).

But if they're all auto height, the browser will distribute the extra
space required by the spanning cell to the other ones in some undefined
but usually vaguely even-handed fashion.

You can't control it more precisely than that. There is nothing in the
specifications to say exactly how this should be done.

Quote:
I've tried the height parameter of the cell (<td>) or the css defition.
However, this (I believe) defines only the minimum height that will
expand if the contents so require.
You can usually "force" the exact height like this:

<td style="height: 200px">
<div style="height: 200px; overflow: hidden">
contents
</div>
</td>

You don't have to use overflow: hidden of course-- overflow: scroll
might be a better choice.


Reply With Quote
  #9  
Old   
Ben C
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent ones to grow? - 01-14-2008 , 05:33 AM



On 2008-01-14, richard <I.dont.care (AT) do (DOT) you> wrote:
Quote:
On Sun, 13 Jan 2008 16:50:45 -0600, Ben C <spamspam (AT) spam (DOT) eggs> wrote:
[...]
You can usually "force" the exact height like this:

td style="height: 200px"
div style="height: 200px; overflow: hidden"
contents
/div
/td

You don't have to use overflow: hidden of course-- overflow: scroll
might be a better choice.

I've seen a few examples of overflow:scroll, where the window created
was so small, that scrolling with the bar was almost impossible. One
must consider just how much data is going to be presented in that
window if scrolling is used.
I agree. Overflow: scroll is fairly horrible. It's generally annoying
to have independently scrolling sub-regions of the page.

But overflow: hidden is a problem because the overflowing content is
hidden.

In general it's better to discourage overflow in the first place and use
overflow: visible.

But the OP asked for a way to make his cells 200px high regardless of
their contents, and this is a way.


Reply With Quote
  #10  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: A rowspan cell grows - how to get only 1 of the adjacent onesto grow? - 01-14-2008 , 09:15 AM



richard wrote:
Quote:
On Sun, 13 Jan 2008 10:01:02 -0500, "Jonathan N. Little"
lws4art (AT) centralva (DOT) net> wrote:

Or not use a table at all since it is most likely not tabular data.

The ol' "Why is it so hard to drive nails with this screwdriver" question.

How would you know unless you saw the data presented?
He was asking a legitimate question on the usage of tables. Not what
was going into it.
There are possibilities of having tabular data expand in one cell but
not others.
If it were tabular data then he would not need to set the height of a
cell, the "natural" behavior of a table to expand and contract to fit
the data would suffice. Tables work that way so that the data may vary
in size but the table preserves the grid orientation that aligns rows
and columns with the associated headings.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.