Avatar of bp_maher
bp_maher

asked on 

Table - Fixed Header with Scrollable Body

Hi,
Could anyone tell me how I can implement a table which is of a fixed height, but which can have a vertical scroll bar and when I scroll , the header columns stay fixed/displayed.

Thanks
HTML

Avatar of undefined
Last Comment
COBOLdinosaur
Avatar of bLUE
bLUE

To scroll a table, Place the table in a DIV with a predefined height and use the overflow style:

example:

<HTML>
<HEAD>
<STYLE>

DIV.poop {
     height:80;
     overflow-y:auto;
     
}

</STYLE>
</HEAD>
<BODY>

<DIV CLASS="poop">
     <TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0">
          <TR>
               <TD WIDTH="56">asdasdasdsdasd</TD>
               <TD WIDTH="100">asdasdasdsdasd</TD>
               <TD WIDTH="134">asdasdasdsdasd</TD>
          </TR>
          <TR>
               <TD>asdasdasdsdasd</TD>
               <TD>asdasdasdsdasd</TD>
               <TD>asdasdasdsdasd</TD>
          </TR>

          <TR>
               <TD>asdasdasdsdasd</TD>
               <TD>asdasdasdsdasd</TD>
               <TD>asdasdasdsdasd</TD>
          </TR>
          <TR>
               <TD>asdasdasdsdasd</TD>
               <TD>asdasdasdsdasd</TD>
               <TD>asdasdasdsdasd</TD>
          </TR>
          <TR>
               <TD>asdasdasdsdasd</TD>
               <TD>asdasdasdsdasd</TD>
               <TD>asdasdasdsdasd</TD>
          </TR>
     </TABLE>
</DIV>

</BODY>
</HTML>


Hope that helps
Avatar of mcs1169
mcs1169

I have done this using frames. Create a table in the upper frame containing your headings. In the <frameset> tag, make the upper frame small enough so that the bottom edge of the table is at the bottom edge of the frame. This will give the illusion of a static header row.
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to COBOLdinosaur

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
Thanks Pasha. :^)

Cd&
HTML
HTML

HTML (HyperText Markup Language) is the main markup language for creating web pages and other information to be displayed in a web browser, providing both the structure and content for what is sent from a web server through the use of tags. The current implementation of the HTML specification is HTML5.

62K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo