27
Aug
08

How to add a scrollbar to a Table Cell

I thought this may be useful, as it is a problem I ran into recently. This is how you place a scrollbar onto a table cell in a html document.

Place this code just the ‘td tag’ of the table cell:

<div style=’height: 200px; overflow: auto;’>

You may want to edit the ‘200px’ to the height you want.

Then add this just before the </td> tag:

</div>

Good Luck!


6 Responses to “How to add a scrollbar to a Table Cell”


  1. 1 Devesh
    November 21, 2008 at 4:17 am

    thanks……..that helped me a lot

  2. 2 Brett & Kim
    December 7, 2008 at 4:07 pm

    Thanks a ton…that really helped.

  3. February 16, 2009 at 6:49 pm

    Once you do have the scroll bar (with a Find feature in my case), how to you also add a print button to print the WHOLE table and not only the part that shows on the screen.

    • February 23, 2009 at 10:44 am

      I am sorry but I could only point you towards posting a thread on one of the many forums around. Unfortunately I am unfamiliar with what you request.

      If you find out a solution, feel free to post it back on here.

      Good Luck! Dave

  4. 5 supueraman
    March 2, 2009 at 6:48 am

    Hi there please could you show me the code for on of the pages where you used this code, cause if I use it, it is not working … thanks

    • March 4, 2009 at 7:46 pm

      Hello. The page I used this for is unfortunately no longer online. Be sure that you understand your not putting a scroll-bar on the table cell itself. Your putting it inside the divider tags that are inside the table cells. The (overflow: “auto”) code won’t work in table cells, but will in divs.

      Best of luck!
      David


Leave a Reply