...

View Full Version : Sortable tables by header



Halli
01-15-2007, 06:57 AM
Hi all, i just have a quick question.

I have been creating sports tables using microsoft excel and want to publish these onto a website. I can easily copy and paste them over, but the problem im having is that i want to be able to sort each table by clicking on the column header. For example if i want to sort the table by wins id click on the 'Wins' header, or if i wanted to sort it by Percentage id hit the '%' header and it will sort the table.

Is there an easy way of doing this? Im using Dreamweaver software to create my website. I dont have much knowledge of Java Script and have been on a few websites where it gives you script to do a sortable header table, but i have not been successful in getting it working yet. Is there a way in Dreamweaver to do this?

If anyone can offer me any advice id be very grateful :)

Thanks,

Halli

chump2877
01-15-2007, 07:40 AM
You want something like this: http://kensall.com/gov/xbrowser/js-only/metaReader.htm

I found this in less than a minute via Google. :rolleyes:

Try to emulate the code there and good luck.


Edit: there's no way in dreamweaver that I know of to do that. Of course I don;t really use dreamweaver, except in code view once and awhile...you may need to learn some javascript or another scripting language to do this.

Halli
01-15-2007, 07:46 AM
Yeh ive been searching for hours and found several sites like this, but i just dont understand what i have to do. Ive tried several things but just cant work out what needs to be done to make the table sortable by the header.

I paste my Table into Dreamweaver straight from excel then im stuck. Ive been through a heap of sites trying to work it out but am at a loss

chump2877
01-15-2007, 07:48 AM
See my edit above in my previous post :)

chump2877
01-15-2007, 07:54 AM
http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting

You probably need a tutorial...I can;t find any at the moment...I tried entering "javascript cross browser sorting table data tutorial" into Google...try entering that or something similar and hopefully you'll come across a tutorial....

You need something that will teach you what the code is doing, so that you can implement it...so like I said before, you'll need to learn a little javascript...

Kor
01-15-2007, 09:39 AM
The Dreamweaver has nothing to do with that. It is a matter of javascript code.
I might give you one of my sortable table code, but this kind of work is strongly personalized, thus you might need to modify it according to your needs. For that you must know javascript quite well....

Maybe if you could give us more details... How your head and several rows of your table look in HTML and which is the action user might do to sort upon the column (click on the header cell)?

And even so, without average knowledge of javascript, you will not be able to understand and to maintain the page/code.

Halli
01-15-2007, 11:01 AM
The Dreamweaver has nothing to do with that. It is a matter of javascript code.
I might give you one of my sortable table code, but this kind of work is strongly personalized, thus you might need to modify it according to your needs. For that you must know javascript quite well....

Maybe if you could give us more details... How your head and several rows of your table look in HTML and which is the action user might do to sort upon the column (click on the header cell)?

And even so, without average knowledge of javascript, you will not be able to understand and to maintain the page/code.

Overall Ladder
# P W L Avg F Avg A Pts% WR%
1 Bullets 24 19 5 112 100 112.2 79.2%
2 Wildcats 25 18 7 100 92 108.5 72.0%
3 Tigers 24 17 7 104 100 104.7 70.8%
4 Crocodiles 27 17 10 110 106 103.8 63.0%
5 Kings 25 15 10 100 96 103.4 60.0%
6 Taipans 26 14 12 100 99 100.6 53.8%
7 Dragons 26 12 14 103 105 97.7 46.2%
8 Slingers 25 10 15 100 103 96.8 40.0%
9 36ers 26 10 16 100 105 95.5 38.5%
10 Hawks 24 9 15 101 104 97.1 37.5%
11 Breakers 25 7 18 102 108 94.1 28.0%
12 Razorbacks 25 3 22 98 110 88.9 12.0%

This is a sample of the table i want to sort. Basically the header is just where it says 'P' or 'W' or 'L' etc, indicatings wins, losses etc. Now im not sure the format will come up properly on this forum so if you take a look at the link below and scroll down to post no.2 you will get a better idea of the format.

http://www.punterslounge.com/forum/showthread.php?t=41409

I dont think its something that would be too hard to do, but for someone thats just starting out im finding it very difficult, so any tips or help you can give me would be apreciated.

Thank you :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum