1

I have a table similar to the following:

Level
$1,000
$500
$100
Other Amount

The HTML is generated by a web based program that allows you to enter your desired values but does not provide an option to re-order them.

The values are ordered highest to lowest but I need them to be lowest to highest.

Here is the HTML that produced the table:

<table width="100%" id="TablePledgeLevelInner">
<tbody>
    <tr>
        <td width="1%">&nbsp;</td>
        <td>Level<br>
        </td>
    </tr>
    <tr>
        <td nowrap="">&nbsp;
            <input type="radio" id="Radio1" onclick="SetAmount(form, 1000);" value="764853" name="PledgeLevelID">&nbsp;
        </td>
        <td>$1,000&nbsp;<br>
        </td>
    </tr>
    <tr>
        <td nowrap="">&nbsp;
            <input type="radio" id="Radio1" onclick="SetAmount(form, 500);" value="764915" name="PledgeLevelID">&nbsp;
        </td>
        <td>$500&nbsp;<br>
        </td>
    </tr>
    <tr>
        <td nowrap="">&nbsp;
            <input type="radio" id="Radio1" onclick="SetAmount(form, 100);" value="764921" name="PledgeLevelID">&nbsp;
        </td>
        <td>$100&nbsp;<br>
        </td>
    </tr>
    <tr>
        <td nowrap="">&nbsp;
            <input type="radio" id="Radio1" onclick="SetAmount(form, 0);" value="764922" name="PledgeLevelID">&nbsp;
        </td>
        <td>Other Amount&nbsp;<br>
        </td>
    </tr>
</tbody>
</table>

How would I reorder this table using Jquery or Javascript? Thanks in advance. Any help is greatly appreciated.

0

1 Answer 1

4

Use jQuery DataTables. It'll let you sort the output and provide loads of other nice functionality out of the box.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.