Page 1 of 1

Table with scrollbar?

Posted: Sat Sep 17, 2005 1:35 pm
by WithHisStripes
Heya,
I know this doesn't directly apply to PHP but I can't find anyone who knows how to do this: I need to create a table with a scrollbar, please tell me one of you know! Thanks

-Spence

Posted: Sat Sep 17, 2005 1:36 pm
by hawleyjr
Put the table in a div tag and set the CSS of the div tag to overflow: scroll;

Posted: Sat Sep 17, 2005 1:54 pm
by WithHisStripes
Thanks for the reply bud, but that didn't seem to work, it puts scrolls on the left hand side of the frame and I need them on the right, but as far as I can see I iserted the div tags in the right hand frame, what am I missing? You can view my files at http://www.hookweb.net/testing/table_with_scroll.zip

-Spence
thanks

Posted: Sat Sep 17, 2005 2:08 pm
by Simulacra
This works in a table
<div style="height: 40em; width: 100%; overflow: auto;">

Posted: Sat Sep 17, 2005 6:49 pm
by s.dot
I don't believe elements scrolling is standards compliant (correct me if I'm wrong)

you should use a div to scroll, even if it's inside the table cell

Code: Select all

<td>
  <div style="height: 100%; width: 100%; overflow: auto;">
  content
  </div>
</td>
PS: Shouldn't this be client side? :P

Posted: Sat Sep 17, 2005 9:04 pm
by John Cartwright
moved to client-side

Posted: Sun Sep 18, 2005 12:13 am
by WithHisStripes
Thanks for the input but I am still either not understanding what you guys are suggesting or overlooking something. Because when I insert that code into my HTML document nothing happens. It messes up my page by adding an extra table or it does nothing at all, and there is definately no scroll bar. Could someone give me an actual example of it inside a table with content and a scroll bar instead?

-Thanks guys

Posted: Sun Sep 18, 2005 3:55 am
by s.dot

Code: Select all

<table width="500" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td>
			<div style="height: 300px; width: 400px; overflow: auto;">
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
				Content<BR>
			</div>
		</td>
	</tr>
</table>
http://www.showmypro.com/test.html <-- works there

Posted: Sun Sep 18, 2005 9:18 am
by pilau
&nbsp; is a hell lot netter than "Content", scrotaye :P :lol: