-2

I have data displaying in an html table. I need to sort only one column https://jsfiddle.net/5a3j7ek1/

<iframe width="100%" height="300" src="//jsfiddle.net/5a3j7ek1/embedded/"  allowfullscreen="allowfullscreen" frameborder="0"></iframe>

how do i get the data from the structure number column and sort it?

Matt
  • 14,906
  • 27
  • 99
  • 149
Nisha Nethani
  • 109
  • 1
  • 1
  • 11
  • You want to sort based off of what? The first column? Second? Are you wanting to use javascript to do this? – chapinkapa Dec 14 '15 at 15:45
  • could you try to take a look to [jQuery table sort](http://stackoverflow.com/questions/3160277/jquery-table-sort) – gaetanoM Dec 14 '15 at 15:48

1 Answers1

0

Including tablesorter: http://tablesorter.com/docs/

HTML

 <table id="mytable" class="tablesorter">
      <thead>
        <tr>
          <th>Last Name</th>
          <th>First Name</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td originalid="pivot__R1" class="p-dim-member" fidx="1" val="109">
            <div class="wrapper">
              <div class="p-head-content"><span>109</span>
              </div>
            </div>
          </td>
          <td>data3</td>
        </tr>

        <tr>
          <td originalid="pivot__R4" class="p-dim-member" fidx="1" val="11" style="height: 24px;">
            <div class="wrapper">
              <div class="p-head-content"><span>11</span>
              </div>
            </div>
          </td>
          <td>data5</td>
        </tr>
      </tbody>
    </table>

JS:

$("#mytable").tablesorter();

https://jsfiddle.net/5a3j7ek1/1/

online Thomas
  • 8,864
  • 6
  • 44
  • 85