Create a gist now

Instantly share code, notes, and snippets.

anonymous /excel_sample.xml
Created Apr 28, 2012

What would you like to do?
pages:excel example
<table>
<caption>Product list</caption>
<thead>
<tr>
<th>Product</th>
<th>Category</th>
<th>Stock</th>
<th>Price</th>
</tr>
</thead>
<tbody th:remove="all-but-first">
<tr th:each="product : ${products}"
pages:excel="name, category.name, stock, price">
<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