Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Making WebFX sortable table to work in IE

Thread Tools

Making WebFX sortable table to work in IE

Posts: n/a
I try to use sortable DHTML table from

Unfortunately, it does not work correctly in IE due to IE bug.

To reproduce:

1. Run the code from the end of this message in IE.
2. Click in the Price column

Observed result:

Sort icon appears in Item column

Expected result:

Sort icon must appear in Price column

Script autor wrote:

It is a bug in IE. The script works fine in all browsers except IE. The bug
IE is that cellIndex returns incorrect values when you hide cells.

From W3C:

cellIndex of type long, readonly
The index of this cell in the row, starting from 0. This index
is in document tree order and not display order.

From MSDN:

Collection indexes are in the source order of the HTML document.
IE does not even follow the MSDN documentation.

Script author refuses to fix it.
He recommands the following fix:

Create a function that looks something like this (too slow to be used in the
regular case)

function getCellIndex(c) {
if (ie)
LOOP and check display
return c.cellIndex

Unfortunately, I'm new to javascript to implement this.
Can anybody fix this bug and create a modified sortabletable.css file ?

Code to reproduce the problem.
you should also load sortabletable.js and sortabletable.css files from

<script type="text/javascript" src="sortabletable.js"></script>
<link type="text/css" rel="StyleSheet" href="sortabletable.css" />
<table class="sort-table" id="table-1" cellspacing="0">
<td style="display:none">id</td>
<td style="display:none">3</td>
<td style="display:none">2</td>


<script type="text/javascript">
var st1 = new SortableTable(document.getElementById("table-1"));

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
NetBeans Application with sortable Table and pre-existing frame/table code Java 6 07-25-2012 04:31 PM
sortable table in python 3.0 Peter Pei Python 1 02-08-2009 06:30 PM
Sortable Java Tree Table yccheok Java 1 12-27-2007 11:31 PM
Again: 2D-Array/Table but sortable asc/desc by column for different datatypes Henri =?ISO-8859-15?Q?Schom=E4cker?= C++ 1 12-17-2005 02:47 PM
Sortable Table dmsc17454_2 Javascript 3 07-16-2004 05:51 PM