Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Sort HTML Table

Posted on 2004-10-05
2
1,530 Views
Last Modified: 2008-01-09
I'm trying to use the sort feature in this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndude/html/dude07232001.asp

This article explains how to highlight rows, sort rows and move columns. I have no problem with the highlight, but when I try to sort I get little white boxes under or beside my column headers and when I click to sort i get a runtime error telling me the column contents (the first row of the column contents) in undefined.

I wonder if my span tags are the problem.

Here is part of the code:

<table style="BEHAVIOR: url(sort.htc);BORDER-COLLAPSE: collapse" slcolor='#FFFFFF' hlcolor='#D0E4f7'
                  border="0" bordercolor="#111111" id="AutoNumber1" width="100%" cellpadding="0">
<THEAD>
                        <tr>
<% if not ReadOnlyActive then %>
<td width="25"><span style="PADDING-LEFT: 1px;  FONT-SIZE: 8pt;  OVERFLOW: visible;  COLOR: #0000ff;  FONT-FAMILY: Tahoma">Out</span></td>
<td width="35"><span style="PADDING-LEFT: 1px; FONT-SIZE: 8pt; OVERFLOW: visible; COLOR: #0000ff; FONT-FAMILY: Tahoma">Move</span></td>
<%end if %>
<td width="54"><span style="PADDING-LEFT: 1px; FONT-SIZE: 8pt; OVERFLOW: visible; COLOR: #0000ff; FONT-FAMILY: Tahoma">Carrier</span></td>

etc. to </THEAD>

<TBODY>
<tr>
<% if not ReadOnlyActive then %>
<td width="25" height="20"><a href="..\movementpages\movement.aspx?PageMode=Outbound&amp;TrailerSCAC=<%=rs.TrailerSCAC%>&amp;TrailerID=<%=rs.TrailerID%>" style="PADDING-LEFT: 1px; LEFT: 0.031in; OVERFLOW: hidden; WIDTH: 16px; CURSOR: hand; COLOR: #ff0000; TOP: 0in; HEIGHT: 16px">O*</a></td>
<td width="35" height="20"><a href="..\movementpages\movement.aspx?PageMode=Move&amp;TrailerSCAC=<%=rs.TrailerSCAC%>&amp;TrailerID=<%=rs.TrailerID%>" style="PADDING-LEFT: 1px; LEFT: 0.031in; OVERFLOW: hidden; WIDTH: 16px; CURSOR: hand; COLOR: #ff0000; TOP: 0in; HEIGHT: 16px">M*</a></td>
<%end if %>
<td width="54" height="20"><span style="PADDING-LEFT: 1px; FONT-SIZE: 8pt; OVERFLOW: visible; COLOR: black; FONT-FAMILY: Tahoma"><%=rs.CarrierSCAC%></span></td>
<td width="54" height="20"><span style="PADDING-LEFT: 1px; FONT-SIZE: 8pt; OVERFLOW: visible; COLOR: black; FONT-FAMILY: Tahoma"><%=rs.TrailerSCAC%></span></td>

etc. </TBODY>
0
Comment
Question by:jamesh1031
2 Comments
 

Expert Comment

by:__rdr__
ID: 12233230
I would copy the table and remove all style formatting and all scripts etc so its just a simple table.

Get the simple table working with the sorter then try applying the style and scripts to it
0
 
LVL 5

Accepted Solution

by:
pmsyyz earned 500 total points
ID: 12233231
Ignore that horrible article on Microsoft's site.  IE-only stuff hurts the Web.  There are plenty of standards compliant ways to sort tables that work in all browsers.  Here are a couple:

sorttable: Make all your tables sortable
http://www.kryogenix.org/code/browser/sorttable/

Sortable Table (WebFX)
http://webfx.eae.net/dhtml/sortabletable/sortabletable.html
simple demo: http://webfx.eae.net/dhtml/sortabletable/demo.html
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
document.write() deleting all existing HTML 5 49
Javascript_Set_dropdown_value 7 40
Html Table Looping (part 2) 5 27
Selected in an option list 13 18
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question