title: Sort A HTML Table In Descending Order
body: <p>I have a HTML table which reads data from my DB but the enteries in the DB are not in order, how do i order my 'Stock' column so that they are in alphibetical order (A-Z)</p>
  
  <p>My HTML for my table is below</p>
  
  <pre><code> &lt;table class="table table-striped"&gt;
        &lt;tr&gt;
            &lt;th style="padding-right: 10px;"&gt;Stock&lt;/th&gt;
            &lt;th style="width: 7%; padding-right: 10px;"&gt;SEDOL&lt;/th&gt;
            &lt;th style="width: 7%; padding-right: 10px;"&gt;Quantity&lt;/th&gt;
            &lt;th style="width: 7%; padding-right: 10px;"&gt;Value&lt;/th&gt;
            &lt;th style="width: 15%;" class="text-center"&gt;Actions&lt;/th&gt;
       &lt;/tr&gt;
       &lt;% foreach (var stck in stocks) {%&gt;
       &lt;tr&gt;
            &lt;td style="vertical-align: middle"&gt;&lt;%: stck.StockName%&gt;&lt;/td&gt;
            &lt;td style="vertical-align: middle"&gt;&lt;%: stck.SEDOL%&gt;&lt;/td&gt;
            &lt;td style="vertical-align: middle"&gt;&lt;%: stck.Quantity%&gt;&lt;/td&gt;
            &lt;td class="text-right" style="vertical-align: middle"&gt;&lt;%: String.Format("{0:c}", stck.value)%&gt;&lt;/td&gt;
            &lt;td class="text-right"&gt;
                 &lt;%if (disinvestments.Find(x =&gt; x.Stock == stck.StockName) != null) {%&gt;
                 &lt;button type="button" class="btn btn-default" disabled id="create_&lt;%: stck.StockName%&gt;" onclick="SetupDisinvestmentsFields(this,'&lt;%=stck.SEDOL%&gt;','&lt;%=stck.Quantity%&gt;','&lt;%=stck.value%&gt;')"&gt;
                      &lt;span class="glyphicon glyphicon-plus"&gt;&lt;/span&gt; Create
                 &lt;/button&gt;
                 &lt;%} else {%&gt;
                 &lt;button type="button" class="btn btn-default" id="create_&lt;%: stck.StockName%&gt;" onclick="SetupDisinvestmentsFields(this,'&lt;%=stck.SEDOL%&gt;','&lt;%=stck.Quantity%&gt;','&lt;%=stck.value%&gt;')"&gt;
                      &lt;span class="glyphicon glyphicon-plus"&gt;&lt;/span&gt; Create
                 &lt;/button&gt;
                 &lt;%} %&gt;
            &lt;/td&gt;
      &lt;/tr&gt;
      &lt;% } %&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Can this be done in JavaScript, JQuery, HTML, i'm not sure whats the best way to this hence my question</p>
  
  <p>P.S. I dont want to have to change the table to a <code>webgrid</code> or <code>datatable</code>.</p>