...

View Full Version : need a way to sort my table..



niyax
03-16-2004, 11:01 AM
i have this table with 2 columns

1st column::has a image of a book and a price
2nd columns::has the title of book, some detail abt the book nd the authors name

here is wat i m trying to do.. i want to be able to sort the table according to the price, title nd authors name.

I hav found many scripts for sorting table but cant get any of them to work with my table mainly because the way the details are distributed in my table.. but its really not possible for me to insert any new columns..nd desparately need a way to sort the table..some help please :( .

here is how my table is:


<table width="100%" border="0" cellpadding="0" cellspacing="0" id=dataTable>
<tr>
<td width="14%" height="149" align="center" valign="middle">
<img src="biogra/TisHerself.gif" height="90" width="68">
<br>Our Price: <font color="#FF0000">$17.50</font>
</td>
<td width="86%" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<strong>Title:<a href="#">'Tis Herself</a></strong>
<br>An exquisite Irish beauty whose film career has spanned<br>
<em>Author:<font color="#FF0000">Maureen O'Hara</font></em></font>
</td>
</tr>
<tr>
<td width="14%" height="149" align="center" valign="middle">
<img src="biogra/DebraGinsberg.gif" height="90" width="68">
<br>Our Price: <font color="#FF0000">$16.76</font></p>
</td>
<td width="86%" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<strong>Title:<a href="#">About My Sisters</a></strong>
<br>Chronicling a year in the life of her close-knit clan
<br><em>Author:<font color="#FF0000">Debra Ginsberg</font></em></font>
</td>
</tr>
</table>

sad69
03-16-2004, 06:54 PM
Oh boy that's a tough one.

It is definately possible, using DOM. However it will take a very long time to come up with a clean solution.

You'd also have to ensure that the structure is ALWAYS the same in each cell, since that's all you can rely upon as your data are not in separate cells.

I can't help you anymore than that I'm afraid. Perhaps someone on here hasn't got a life and can be of more assistance.

I might want to add that you could use a server-side language to implement this, perhaps a little more easily... especially if your inventory changes regularily and you want to keep your data in a database... just a thought.

Good luck,
Sadiq.

Garadon
03-17-2004, 11:50 AM
www.the-hive.dk/~donp/t.html

remember don't remove the header in the js file.

sad69
03-17-2004, 06:24 PM
Perhaps someone on here hasn't got a life and can be of more assistance.


No offence Garadon, lol! Good job though, nice one!

Sadiq.

Garadon
03-17-2004, 09:40 PM
Non taken I know I ain't got a life. I am AI



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum