How to sort an html table
Posted Date Unknown BINTA PRASAD 6 Comments

Hi..

  I have an html table(static) without any header tags.I need to sort the table in alphabetic order based on a particular  
  column.Please help me..

Thanks in advance



See All Responses Below...
Author
Message Rating
Posted on: 06/09/2012
If the table is static HTML , then you need to sort it in the DB query itself and fill the contents in the dataset in the table one by one with appropriate HTML tags.

Alternatively there is an ASP.NET table control shipping with Visual studio .. Probably it might have the sort option.. Please try that control..

Tom

Posted on: 06/09/2012
You can make an html table sortable with the help of Javascript. Try the instructions from, http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/expression-web/sort-table.html
Share this page across other social networking sites



Posted on: 06/09/2012
hai...
 you just try with the link given below using script

http://www.codeproject.com/Articles/1604/Sorting-HTML-Tables-using-Javascript

Posted on: 07/09/2012
This should work I believe..see whether it suites your purpose..

Tom
Share this page across other social networking sites



Posted on: 07/09/2012
Thanks 4 all the replies.Let me be more specific about my question,in my table i dont have header tags.I want my table to get sorted without clicking on any header tags.In all the links above while clicking on the column header the table gets sorted...
Posted on: 07/09/2012
its simple.......

try with some change
1. add a dummy row at top.
2. open  sortTable.js and change

sortTable("column no which you want to sort", table.id, 0);
 
and

var updownColor = 'white'; // or remove it
Share this page across other social networking sites



Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Comments
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

TekTipsDownload
GateExam
Academic Projects
TekTipsExperts



 
Site optimized for IE7, 1280 X 768 and above. Copyright © 2010 - 2018 KTS InfoTech
Site Developed Using KTS WebCloud