Freeze first row in a table AND (!!) keep it aligned with the rest

liunx

Guest
I wonder if it is possible to freeze the first row in a table and at the same time keep it aligned with the rest of the table contents as the width of the cells change dynamically. (Part of an .asp-page)<br />
<br />
(I tried to solve this by creating two separate tables and aligning the first with the second by checking the width of all the cells in the second table. As the tables contains lots of cells, this is too time-consuming in a web-page. I put the second table in a separate scrollable <div>...) <br />
<br />
If this is not possible, is it possible to "group" two tables so that they are always aligned?<br />
<br />
=:O All help really appreciated!! =:O<!--content-->I think there was a way to do this. I can't remember, but I'll see if there was something.<br />
<br />
In fact, I might have posted a similar question about 6 months or so ago.<!--content-->Thanks! Hope you find a solution for me :confused:<!--content-->okay - my thread about "sticky" table cells:<br />
<br />
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=25601&highlight=table">http://www.htmlforums.com/showthread.ph ... ight=table</a><!-- m --> <br />
<br />
and a quick jump to a snippet:<br />
<br />
<!-- m --><a class="postlink" href="http://www.snippetlibrary.com/viewhtml.php?id=4&kid=138&siteid=232">http://www.snippetlibrary.com/viewhtml. ... siteid=232</a><!-- m --> <br />
<br />
I never did get it to go in both directions, though.<!--content-->That snippet uses two tables with fixed sized column widths, thus it is completely unusuable for me!! You can not change the width of a cell in the lower table and make the corresponding column in the upper one change accordingly! THAT is what I need :( <br />
<br />
Thanx anyway! Appreciate more tips!<!--content-->You could use some kind of server side to link the widths of the two tables.<br />
<br />
Example:<br />
<br />
<br />
<?php<br />
$table_width[0] = 100;<br />
$table_width[1] = 200;<br />
$table_width[2] = 300;<br />
?><br />
<br />
<table><br />
<tr><br />
<td width='<?php echo $table_width[0]; ?>'><br />
header<br />
</td><br />
<br />
<td width='<?php echo $table_width[1]; ?>'><br />
header<br />
</td><br />
<br />
<td width='<?php echo $table_width[2]; ?>'><br />
header<br />
</td><br />
</tr><br />
</table><br />
<br />
<table><br />
<tr><br />
<td width='<?php echo $table_width[0]; ?>'><br />
content<br />
</td><br />
<br />
<td width='<?php echo $table_width[1]; ?>'><br />
content<br />
</td><br />
<br />
<td width='<?php echo $table_width[2]; ?>'><br />
content<br />
</td><br />
</tr><br />
</table><br />
<br />
<br />
And of course, you need to put whatever that snippet said for maing the second table scrollable (i guess its in a div or something).<!--content-->you can't move the cell bigger in a table with the mouse anyway. what you want is to create a dhtml script and not use a table. I sw somewhere where you can do this with a iframe but not sure where I seen it. I think it was a iframe.<br />
<br />
if you want that funcitonality then use excel, as I don't think you will find wha tyou want.<!--content-->oh - i didn't realise you wanted it user resizeable. <br />
<br />
That's getting a bit over my head there.<!--content-->
 
Back
Top