Skip to content

WD ATTR Tsort Tool

wdonadelli edited this page Apr 2, 2022 · 3 revisions

WD ATTR Tsort Tool

The reference for how the attribute works is in the following tools:

The attribute targets are the cell elements (th or td) contained in the row element (tr) inserted in the table header (thead). The result influences the row elements (tr) inserted in the table body (tbody).

<table>
	<thead>
		<tr>
			<th>#</th>
			<th data-wd-tsort="" >Col 1</th>
			<th data-wd-tsort="" >Col 2</th>
			<th data-wd-tsort="" >Col 3</th>
		</tr>
	</thead>
	<tbody>
		<tr><td>0</td><td>D</td><td>A</td><td>D</td></tr>
		<tr><td>1</td><td>C</td><td>C</td><td>B</td></tr>
		<tr><td>2</td><td>B</td><td>B</td><td>A</td></tr>
		<tr><td>3</td><td>A</td><td>D</td><td>C</td></tr>
	</tbody>
</table>

When the element with the attribute is clicked, its column will be sorted in ascending order. If you click again, the sort order will be reversed.

Clone this wiki locally