Create a gist now

Instantly share code, notes, and snippets.

anonymous /sort_example.xml
Created Apr 28, 2012

What would you like to do?
pages:sort example
<table>
<caption>Product list</caption>
<thead>
<tr>
<th pages:sort="name">Product</th>
<th pages:sort="category.name">Category</th>
<th pages:sort="stock">Stock</th>
<th pages:sort="price">Price</th>
</tr>
</thead>
<tbody th:remove="all-but-first">
<tr th:each="product : ${products}">
<td th:text="${product.name}">Chair</td>
<td th:text="${product.category.name}">Apparels</td>
<td th:text="${product.stock}">12</td>
<td th:text="${product.formattedPrice}">150 €</td>
</tr>
<tr>
<td>Table</td>
<td>Apparels</td>
<td>8</td>
<td>500 €</td>
</tr>
<tr>
<td>Wardrobe</td>
<td>Apparels</td>
<td>15</td>
<td>650 €</td>
</tr>
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment