Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi Guys I've been puzzling over

Status
Not open for further replies.

jm99

Programmer
Jun 14, 2001
27
0
0
GB
Hi Guys

I've been puzzling over this one for a few hours now so I thought I'd open it up to the floor.

Basically, I want the second cell in the second column to immediately follow the first cell in the second column, i.e. For there to be no vertical space between them.

Due to the nature of the application that is being written, css positioning is definitely not an option.

Any ideas?

<html>

<body>

<table border=3>

<tr>
<td valign=top rowspan=2>
One<br><br><br><br><br><br><br><br><br><br>
</td>
<td valign=top>
Two
</td>
</tr>
<tr>
<td valign=top>
Three
</td>
</tr>
</table>
</body>
</html>
 
I don't get it. It looks good to me (IE4.0 and NN4.73).

I don't see any vertical space??
Maybe you can be more specific?

Erik
 
Hi Erik

The effect that I'm trying to achieve is approximately:

One Two
Three

rather than

One Two



Three

The <br> tags in the first column are there to simulate the presence of a large quantity of text that I thought would detract from the issue.

Any help appreciated...
 
The height of 'one' = total-height of 'two' and 'three'

If you set the height of 'three' you will see that 'three' is going up, i.e.

<td height=350 valign=top>Three</td>

Erik
 
That's great boomerang but I was wondering if anybody knows of a way to have 'three' automatically expand in that fashion, (i.e. without having to explicitly set the height attribute). I'll take a peak at the specs again and post back if I find anything.

Thanks for your help
 
I did allready tried it, see my example below, but my problem is :

1)Is the onload in the body the right place to fire the function?
2)How to get the value c3height in de cellheigth where I put &quot;??????&quot; now

(the alertboxeas are only to show the values)

I'm NOT so good in javascript so maybe a javascript-pro can take it over?

jm99: if you get no more replies, post the javascript part at the javascript-forum.

<body onload=&quot;cellheigth();&quot;>

<script language=&quot;javascript&quot;>

function cellheigth()
{
var c1heigth = window.c1.offsetHeight;
var c2heigth = window.c2.height;
var c3heigth = c1heigth - c2heigth;
alert(c1heigth);
alert(c2heigth);
alert(c3heigth);
}

</script>

<table border=3>

<tr >
<td id=c1 name=c1 valign=top rowspan=3>
One<br><br><br><br><br><br><br><br><br><br><br><br>
<td id=c2 name=c2 height=20 valign=top>
Two
</td>
</tr>
<tr>
<td height=&quot;??????&quot; valign=top>
Three
</td>
</tr>
</table>

Erik
 
Normally I'd say that body.onload is a fine location for such a script but the implementation is using JSP, (so there's no direct access to the body tag server-side by the time that this table-building routine is hit). I know that I can add a function to the body tag onload, (there's an faq around here somewhere), but I think that it'd be just as good to simply insert a script tag immediately after the table has been built that fires the routine.

Thanks very much for all your help, it'd have been nice if this was possible without script but heyHo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top