Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort the HTML table data (on the client side) using javascript

Status
Not open for further replies.

hktektips

Programmer
Joined
Jun 14, 2001
Messages
2
Location
US
Hi !

I'm writing a javascript to sort the html data using NN4.75 the script works perfectly fine under MSIE but is not executed using NN.

Below is the code from the ".shtml" where I'm calling the above mentioned javascript.

</HEAD>
<BODY>
<TABLE WIDTH=&quot;75%&quot; BORDER=1 CELLSPACING=0 CELLPADDING=2
name=&quot;rsTable&quot; id=rsTable cols=5 bordercolordark=ffffff
bordercolorlight=000
000 bgcolor=cccccc align=center>
<TR bgcolor=mediumblue>
<TD>
<A href=&quot;javascript:sortTable(0, rsTable);&quot;><FONT
color=white><B>ID</FONT></B></A>
</TD>
.....

There are five column (ID, NAME, DATE, PHONE, WORKFLOW) in the table on which the data is getting sorted.

Let me know if I need to add any NN specific code in here. The sort function of the javascript is too lengthly. I don't want to paste the whole code here. If anybody wants to take a look will be happy to do so.

Within the javascript the function is called as below:

function sortTable(col, tableToSort)

FYI ... Under NN4.75 it errors out as &quot;rsTable is not defined&quot;

Thanks in advance !!

- hk
 
I didn't think there was a common solution for IE and NS on this one. I was not correct.

Seems that IE and NS just need to do it differently.

Here is a link to an O'Reilley publication that is
a sample of one of the fine books they sell.

It shows an IE and an NS implementation.



IRT has a great article about table sorting:



For one IE only version

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top