검색결과 리스트
tablesort에 해당되는 글 1건
- 2012.09.06 Sorting HTML Tables using Javascript
글
sortTable.zip
Introduction
This JavaScript code can be used to convert tables in ordinary HTMLinto sortable ones by associating each title column with an onClick event to automaticallysort the data rows.
No additional coding is necessary. All you need to do is give yourtable an ID field, include the sortTable.js file and call initTable in your document's onLoad method.
<HTML>
<HEAD>
<TITLE>Sample Table</TITLE>
</HEAD>
<BODY onLoad='initTable("table0");'>
<SCRIPT SRC="sortTable.js"></SCRIPT>
<TABLE ID="table0" BORDER=1>
<TBODY>
<TR><TD ROWSPAN=2>NO</TD><TD COLSPAN=2>IDS</TD><TD ROWSPAN=2>Date</TD></TR>
<TR><TD>ID</TD><TD>Device ID</TD></TR>
<TR><TD COLSPAN=4> </TD></TR>
<TR><TD COLSPAN=3> </TD><TD> </TD></TR>
<TR><TD>1</TD><TD>k</TD><TD>00030</TD><TD>11/09/01 12:14:00 pm</TD></TR>
<TR><TD>2</TD><TD>c</TD><TD>00006</TD><TD>11/11/01 12:15:00 pm</TD></TR>
<TR><TD>3</TD><TD>a</TD><TD>00016</TD><TD>10/16/01 08:14:00 am</TD></TR>
<TR><TD>4</TD><TD>b</TD><TD>00031</TD><TD>09/05/01 10:05:00 am</TD></TR>
</TABLE>
출처 : http://www.codeproject.com/Articles/1604/Sorting-HTML-Tables-using-Javascript
'-- JavaScript' 카테고리의 다른 글
javascript replace (0) | 2014.05.21 |
---|---|
javascript로 number_format 구현 (0) | 2013.09.26 |
이메일주소 쿠키에 저장하고 불러오기 (0) | 2012.08.28 |
Google Maps API & Marker Clusterer (0) | 2012.08.21 |
Javascript 일반전화, 휴대폰, 이메일 Validation (0) | 2012.08.16 |
RECENT COMMENT