Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-16-2004, 10:01 AM   PM User | #1
niyax
New to the CF scene

 
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
niyax is an unknown quantity at this point
Unhappy need a way to sort my table..

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:

Code:
<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>

Last edited by niyax; 03-16-2004 at 10:37 AM..
niyax is offline   Reply With Quote
Old 03-16-2004, 05:54 PM   PM User | #2
sad69
Senior Coder

 
Join Date: Feb 2004
Posts: 1,206
Thanks: 0
Thanked 0 Times in 0 Posts
sad69 is an unknown quantity at this point
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.
sad69 is offline   Reply With Quote
Old 03-17-2004, 10:50 AM   PM User | #3
Garadon
Regular Coder

 
Join Date: Jul 2002
Posts: 698
Thanks: 0
Thanked 0 Times in 0 Posts
Garadon is an unknown quantity at this point
www.the-hive.dk/~donp/t.html

remember don't remove the header in the js file.
Garadon is offline   Reply With Quote
Old 03-17-2004, 05:24 PM   PM User | #4
sad69
Senior Coder

 
Join Date: Feb 2004
Posts: 1,206
Thanks: 0
Thanked 0 Times in 0 Posts
sad69 is an unknown quantity at this point
Quote:
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.
sad69 is offline   Reply With Quote
Old 03-17-2004, 08:40 PM   PM User | #5
Garadon
Regular Coder

 
Join Date: Jul 2002
Posts: 698
Thanks: 0
Thanked 0 Times in 0 Posts
Garadon is an unknown quantity at this point
Non taken I know I ain't got a life. I am AI
Garadon is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:57 AM.


Advertisement
Log in to turn off these ads.