Home Discussion Discuss: JavaScript sort table

  • i want mack a color Array table in Javascript.wasim June 7, 2011 at 11:45 AM

    <H2>JavaScript Sort Table</H2> <SCRIPT type="text/javascript" src="sort.js"></SCRIPT> <TABLE WIDTH="55%" BORDER="1" name="table" id="table" cols="4"> <TR><TD><A href="javascript:sortTable(0, table);"><FONT color="red"><B>ID</FONT></B></A></TD> <TD><A href="javascript:sortTable(1, table);"><FONT color="red"><B>NAME</FONT></B></A></TD> <TD><A href="javascript:sortTable(2, table);"><FONT color="red"><B>ADDRESS</FONT></B></A></TD> <TD><A href="javascript:sortTable(3, table);"><FONT color="red"><B>SPECIALIZATION</FONT></B></A> </TD></TR></FONT> <TR><TD>1</TD><TD>Angelina</TD><TD>Delhi</TD><TD>Computer Science</TD></TR> <TR><TD>2</TD><TD>Martina</TD><TD>Lucknow</TD><TD>Mathematics</TD></TR> <TR><TD>3</TD><TD>Tina</TD><TD>Chennai</TD><TD>English</TD></TR> <TR><TD>4</TD><TD>Simran</TD><TD>Mumbai</TD><TD>Biology</TD></TR> <TR><TD>5</TD><TD>Christina</TD><TD>Kolkata</TD><TD>Psychology</TD></TR> </TABLE>

  • sort numericB Herbert October 18, 2012 at 6:48 PM

    I was able to make your code work nicely except some of my columns are numeric. Example: If Christina was ID=15 the id column would not sort correctly

  • reverse methodb herbert October 24, 2012 at 9:45 PM

    I am a beginner. The sort.js works great after I added a setDataType function. How can I (when the column header is clicked) sort or reverse the column data. I replaced the column.sort with column.reverse and it works but only for the first column. No matter which column header is clicked.

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Java Beginners

Sort
all the votes have been counted, the program should output a table showing how 

PHP Questions

sort table by dropbox entry
sort table by dropbox entry  Hi All, I current have the following... drop down to the table BUT and am unable to get this to do anything. The dropdown pulls its data from another dedicated table(works) but I need an OnCHANGE 

Programming Tutorials

JavaScript sort table
JavaScript sort table..., we are going to sort the table using the JavaScript. To sort the table, we...: <HTML> <H2>JavaScript Sort Table</H2> <SCRIPT 

Applet Questions

How to add dropdown list in a row of a sort table applet?
How to add dropdown list in a row of a sort table applet?  How to add dropdown list in a row of a sort table applet 

SQL Tutorial

Mysql Date Sort
; Mysql Date Sort is used to return the sort  records or rows value in table... Sort. To understand this example, we create a table 'employee1' with field name...) Query to sort data from the table according to Empname created 

JSP Servlet Questions

How to Sort Column values of a jsp table - JSP-Servlet
How to Sort Column values of a jsp table  Hi Friend Please help me. I am displaying reultset values on multiple jsp page. I want to sort selected column values on every page onclick of an event its very urgent pleasehelp 

JSP Servlet Questions

Sort Result set
Sort Result set   I build a connect for my page with the database and then read all rows and show it in a table, I want to change the view of my data... name is a hyperlink. also how to delete a row from the table? if I have 

Java Beginners

Sort
Sort  program to sort a list of numbers in decendimg order   Hi Friend, Try the following code: import java.util.*; class SortListInDescendingOrder{ public static void main(String[] args 

JSP Servlet Questions

String array sort
); %> <form action="../bus/route_search.jsp"> <table width="297 

JSP Servlet Questions

String array sort
); %> <form action="../bus/route_search.jsp"> <table width="297 

JSP Servlet Questions

sort a record in jsp - JSP-Servlet
sort a record in jsp  hello, can i get a code that displays 10 records per page from a table student and when i click on the next button... In the above code,we have taken the database table student 

JavaScript Questions

Extjs Table Sorting
Extjs Table Sorting  how is it possible to do the table sort in extjs 

JSP Interview Questions

Extjs Table Sorting
Extjs Table Sorting  how is it possible to do the table sort in extjs 

EJB Questions

Extjs Table Sorting
Extjs Table Sorting  how is it possible to do the table sort in extjs 

Java-Tutorials

JDBC: Sorting Table Example
JDBC: Sorting Table Example In this section, you will learn how to sort your table records under any column using JDBC API. ORDER BY Clause : You can sort your table record either in ascending order or in descending order 

Java Beginners

bubble sort
bubble sort  how to calculate the number of passes in bubble sort 

Development process Questions

insertion sort
insertion sort  how many arrays needed for insertion sort and why 

Java Interview Questions

bubble sort
bubble sort  write a program in java using bubble sort 

Java Interview Questions

insertion sort
insertion sort  write a program in java using insertion sort 

Java Interview Questions

insertion sort
insertion sort  write a program in java using insertion sort 

Java Interview Questions

insertion sort
insertion sort  write a program in java using insertion sort 

Java Interview Questions

insertion sort
insertion sort  write a program in java using insertion sort 

Java Beginners

Array sort
Array sort  Program that uses a function to sort an array of integers 

HTML Questions

Imp-HTML Table Sorting
Imp-HTML Table Sorting   Hi, I am working on a project and as per requirement from client i have to sort a table based on the ID Column. I want the table to be sorted as per ID Column once it's loaded. I found many programs 

Java Beginners

buble sort
buble sort  ascending order by using Bubble sort programm   Java BubbleSort Example 

MySQL

Table Maintenance Statements
, sort them.  If the table's statistics are not up to date (and the repair... Table Maintenance Statements   ... TABLE, BACKUP TABLE, CHECK TABLE, CHECKSUM TABLE, OPTIMIZE TABLE, REPAIR TABLE 

Java Beginners

SEARCH AND SORT
SEARCH AND SORT  Cam any one provide me the code in java that : Program to search for MAX,MIN and then SORT the set using any of the Divide and conquer method 

Java Beginners

quick sort
; System.out.println(" Quick Sort\n\n"); System.out.println("Values Before the sort:\n"); for(i = 0; i < array.length; i++){ array[i...("Values after the sort:\n"); for(i = 0; i <array.length; i 

Java Beginners

quick sort
; System.out.println(" Quick Sort\n\n"); System.out.println("Values Before the sort:\n"); for(i = 0; i < array.length; i++){ array[i...("Values after the sort:\n"); for(i = 0; i <array.length; i 

Java Beginners

quick sort
; System.out.println(" Quick Sort\n\n"); System.out.println("Values Before the sort:\n"); for(i = 0; i < array.length; i++){ array[i...("Values after the sort:\n"); for(i = 0; i <array.length; i 

DMCA.com