File: examples/Example2.html

Recommend this page to a friend!
  Classes of Jackson Knowlton  >  JS Sortable Table  >  examples/Example2.html  >  Download  
File: examples/Example2.html
Role: Example script
Content type: text/plain
Description: Uses the more complex functions of sortableTable
Class: JS Sortable Table
Make HTML tables sortable with clickable headers
Author: By
Last change: fixed bug
Date: 4 years ago
Size: 1,553 bytes


Class file image Download
<!DOCTYPE html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Simplest Use</title>

    <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>

    <script language="javascript" src="../sortableTable.class.js"></script>

    <link rel="stylesheet" href="../sortableTable.css"/>

        table, td, th{
            border-collapse: collapse;
            border: 1px solid black;
<button onclick="sTable.init('#sortableTable1')">Initialize Table</button> &nbsp;
<button onclick="sTable.sort($('.noSort'), 'up')">Sort by the '.noSort' column</button>
<table id="sortableTable1">
        <th>First Name</th>
        <th>Last Name</th>
        <th class="noSort">Email</th>
<p>The Email header contains the class 'noSort', which is why the arrows don't appear on initialization.</p>

    var sTable = new sortableTable();