1

I have the following code that I want to modify so that the tbody can have a scrollbar without the thead moving:

<table class="sortable"> <thead border="0" cellspacing="0" cellpadding="2" align="left" style="position:relative; bottom:-3px; left:0px;"> <tr> <% For i = 0 to Ubound(hdVals) if i = 0 then response.Write "<td class=""symbollng"" valign=""bottom"" style=""border-right:0px; border-left:0px;"">" & hdVals(i) & "</td>" & vbnewline elseif i = 1 then response.Write "<td class=""close-hd"" valign=""bottom"">" & hdVals(i) & "</td>" & vbnewline else dstrVals(i-2,0) = hdVals(i) response.Write "<td class=""col-hd-wd"" valign=""bottom"">" & hdVals(i) & "</td>" & vbnewline end if Next %> </tr> </thead> <tbody class="scrollContent"> <% EO = "odd" For i = 1 to Ubound(tmpRows)-1 if EO = "odd" then response.Write "<tr class=""grey"">" & vbnewline else response.Write "<tr>" & vbnewline end if tmpRowVals1 = split(tmpRows(i),"=") tmpRowVals = split(tmpRowVals1(1),":") For j = 0 to Ubound(tmpRowVals) if j = 0 then response.Write "<td class=""symbollng""><span title=""" & tmpRowVals(j) & """>" & tmpRowVals(j) & "</span></td>" & vbnewline elseif j = 1 then if trim(tmpRowVals(j)) = "" then response.Write "<td class=""close"">&nbsp;</td>" & vbnewline else response.Write "<td class=""close""><span title=""" & tmpRowVals(j) & """>" & tmpRowVals(j) & "</span></td>" & vbnewline end if else Call addToDistChart(j-2,tmpRowVals(j)) gTime = hdVals(j) response.Write getCellColorWithClick(curlv(tmpRowVals(j)),tmpRowVals(0),gSec,gChar,gTime) end if Next response.Write "</tr>" & vbnewline if EO = "odd" then EO = "even" else EO = "odd" end if Next %> </tbody> </table> 

Here is a picture of the design I have so far for the table:

enter image description here

Hopefully its a small edit in my code since dealing with tables has been a pain :(

2 Answers 2

1

There's a really simple jQuery-based solution at fixedheadertable.com.

Sign up to request clarification or add additional context in comments.

1 Comment

Hmm Ill try this and see what I get as a result
0

Found a solution, its a jquery plugin that formats tables and autodetects the values in the columns which can sort them correctly. It also produces a nice ui interface that can be styled to your liking:

http://www.datatables.net/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.