PDA

View Full Version : Table scroll


florida
03-24-2003, 12:37 PM
I am trying to get a scroll bar to work in my table. It works great in IE but in Netscape 4.77 this doesnt work. Anything I need to do in Netscape 4 to get a scrollbar to work in my Table??

<DIV style="height:200px;width :600px;overflow:auto;">
<TABLE cellSpacing=2 cellPadding=4 border=0 style="width:98%;height:98%;">
<TR>
<TD width="15%"><B>data</B></TD>
<TD width="35%">moredata</TD>
<TD width="15%"><B>anotherlineetc..</B></TD>
</TR>
</TABLE>
</DIV>

cg9com
03-24-2003, 02:09 PM
Not really a javascript question. :) (HTML&CSS)

how would you get it to overflow if the table is measured in a percentage? unless you have a lot of text, i would think it would just fit itself inside your container div, yes? :)

Im not too clear on CSS for NS4, it might just be that its not supported, because .... well its NS4 :D:D

brothercake
03-24-2003, 04:19 PM
Nope - netscape 4 does not support CSS overflow.

florida
03-24-2003, 05:50 PM
If not in CSS, there must be a way to do it with <layer> but I cant seem to find one in my books.

brothercake
03-24-2003, 07:16 PM
There probably is a way, although it's probably unstable at best.

My advice to you would be forget it; forget netscape 4. That doesn't mean don't support it at all, it just means don't try and provide DHTML rich content - give ns4 a plain, unstyled layout, as you would for netscape 3.

But that's just IMO :) Dan Steinman was always the authoritative source for using ns4's <layer> setup - http://www.dansteinman.com/dynduo/

qazs
08-24-2004, 10:27 AM
hi,
thanks for the script. has been looking for this for quite a while.
Is there a way to have a scrollbar in one column only?
For example i have a table with 2 columns, and i only want the column on the right to scroll..
When i use the <div> tag, it scrolls the whole table....

Thanks.

Roy Sinclair
08-24-2004, 06:34 PM
<td style="overflow: scroll;">...</td>

qazs
08-28-2004, 05:41 PM
hi,
thanks, but this doesnt work......

martin the 3rd
08-28-2004, 10:55 PM
It should work...You know that you need to put <table> and <tr> tags around it, right?

-m3

qazs
08-29-2004, 08:47 AM
take a look at this:

<table width="160" height="50" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="47">Ah</td>
<td style="overflow:scroll;width:111px;height:50px;">dfdffff<br>
dfdfdfdfdffdf<br>
sdsdwewqeqe
fhfghgfhgfh</td>
</tr>
</table>


Help me to insert a scrollbar into the 2nd column. Thanks very much.

mcdougals4all
08-29-2004, 02:59 PM
I've never used this technique, so I can't say how reliable it is across different browsers.

Instead of trying to create a scrollbar on your table cell, create a div within your table cell like this:
<table width="160px" height="50px" border="1" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="47">Ah</td>
<td style="width:111px;height:50px;">
<div style="overflow:auto; height:50px;">
dfdffff<br>
dfdfdfdfdffdf<br>
sdsdwewqeqe<br>
hfghgfhgfh<br>
hfghgfhgfh<br>
fhfghgfhgfh<br>
fhfghgfhgfh<br>
</div>
</td>
</tr>
</table>


For the sake of consistency, I'd use CSS for all the formatting. Like where you have the first cell defined using width="47" and the second using style="width:111px;", stick to the second method. Also be sure when defining width, height, etc. that you are also specifying the unit of measure whether its pixels, ems, or percent.

qazs
08-29-2004, 03:25 PM
Hey, thanks a lot! This works.

babycam
10-15-2004, 12:22 AM
hi, i'm fairly new to coding....

i have used <div style="overflow;> tag in a table i want a vertical scroll bar on...

have had 2 problems so far.
1. the table im using has a border and without CellPad the text is hard upagaint the borders and dosent look good. but with CellPad (set at 15) the scroll bar is also padded in.

Does anyone know how to position the scroll bar so it sits on the hard right of the table and so there are no gaps between the tops and bottom of the table and scroll bar

]|V|[agnus
10-15-2004, 12:35 AM
I'd start with removing the padding on the offending cell...