Scrollbar in Table?

  Charence 16:29 27 May 2006

Hi, I'm currently having trouble setting the height of a cell in a table. It will only let me set the value in pixels, but I would like to use percentage so that the page will display properly on all screen resolutions.

I've used div> tags to allow the cell to be scrollable.

div style="height: 420px; overflow:auto;">
cell content

Is it possible to make the height a percentage instead?


click here for site

  Forum Editor 16:48 27 May 2006

was to wonder why you want the text to be in a table cell in the first place - it's a slight irritation to have to scroll to read. It might look far better just laid out as text on the page in the first place, especially as there's not much of it.

Anyway, in answer to your question click here

  Charence 16:52 27 May 2006

Thanks FE. It wasn't my decision to have the text in a scrollable cell, the other people in my group said they want it to be like that. I'll try to change their minds :-)


  PurplePenny 18:01 28 May 2006

You can use percentages for the height of a td. Have you tried adding the height to the td instead of the div?

  PurplePenny 18:08 28 May 2006

Did you change their minds? I didn't have to scroll anything - even when I enlarged the text.

P.S. Weren't you at school when you first posted to the forum?

  Charence 18:18 28 May 2006

:-) Yes I eventually managed to change their minds and yes I think I was doing GCSEs when I first posted here.

I just tried adding height to td but it seems to be a lower limit, it's only used when the number of lines doesn't exceed the height. Setting a tr height seems to have similar effects. Maybe I'm doing something wrong?

Thanks for your help FE and PurplePenny; I'll tick this now, but I'm still interested how/if this can be done.


  Charence 18:01 02 Jun 2006

Thank you once again everyone.

Here's what the final product looks like...I've just handed it in.
click here


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

iPhone X review

Political cartoons in 2017: Chris Riddell, Rebecca Hendin and Dave Brown on what it’s like to…

The best iPhone for 2017

Tennis : comment regarder la finale de la Coupe Davis 2017 ?