JSFiddle - React, Tailwind, and code Playground

by marcuswhybrow

HTML

<table>
    <tr>
        <th class='sortable' data-sort-name="title">
            Title
            <img class='sort_indicator' src='/images/sort_unsorted.jpg' /> 
        </th> 
        <th class='sortable' data-sort-name="nature"> 
            Procurement type
            <img class='sort_indicator' src='/images/sort_unsorted.jpg' /> 
        </th>
    </tr>
</table>

CSS

th {
    padding: 10px 20px;
    border: 1px solid #ddd;
}

JavaScript

$('th.sortable').click(function() {
    alert('/procurements?sort=' + $(this).attr('data-sort-name'));
});