Skip to content

Commit a9f36bf

Browse files
committed
Clean up HTML table rendering.
1 parent 23355a1 commit a9f36bf

File tree

7 files changed

+42
-28
lines changed
  • 2-reactive/src/main/resources/templates
  • 2b-reactive/src/main/resources/templates
  • 3-reactive/src/main/resources/templates
  • 4-reactive/src/main/resources/templates
  • 5-reactive/src/main/resources/templates
  • 9-reactive-quick/src/main/resources/templates
  • 9-reactive-repository/src/main/resources/templates

7 files changed

+42
-28
lines changed

2-reactive/src/main/resources/templates/home.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,30 @@ <h1>Welcome to Hacking with Spring Boot!</h1>
1010
<!-- tag::1[] -->
1111
<h2>Inventory Management</h2>
1212
<table>
13-
<th>Id</th><th>Name</th><th>Price</th>
13+
<thead><tr><th>Id</th><th>Name</th><th>Price</th></tr></thead>
14+
<tbody>
1415
<tr th:each="item : ${items}">
1516
<td th:text="${item.id}"></td>
1617
<td th:text="${item.name}"></td>
1718
<td th:text="${item.price}"></td>
1819
<td><a th:href="@{'/add/' + ${item.id}}">Add to Cart</a></td>
1920
<td><a th:href="@{'/delete/' + ${item.id}}">Delete</a></td>
2021
</tr>
22+
</tbody>
2123
</table>
2224
<!-- end::1[] -->
2325

24-
<!--<h3>Add New Inventory</h3>-->
25-
<!--<form method="post" action="/">-->
26-
<!--<input name="name" type="text" />-->
27-
<!--<input name="price" type="text" />-->
28-
<!--<input type="submit" />-->
29-
<!--</form>-->
30-
3126
<!-- tag::2[] -->
3227
<h2>My Cart</h2>
3328
<table>
34-
<th>Id</th><th>Name</th><th>Quantity</th>
29+
<thead><tr><th>Id</th><th>Name</th><th>Quantity</th></tr></thead>
30+
<tbody>
3531
<tr th:each="cartItem : ${cart.cartItems}">
3632
<td th:text="${cartItem.item.id}"></td>
3733
<td th:text="${cartItem.item.name}"></td>
3834
<td th:text="${cartItem.quantity}"></td>
3935
</tr>
36+
</tbody>
4037
</table>
4138
<!-- end::2[] -->
4239

2b-reactive/src/main/resources/templates/home.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,30 @@ <h1>Welcome to Hacking with Spring Boot!</h1>
1010
<!-- tag::1[] -->
1111
<h2>Inventory Management</h2>
1212
<table>
13-
<th>Id</th><th>Name</th><th>Price</th>
13+
<thead><tr><th>Id</th><th>Name</th><th>Price</th></tr></thead>
14+
<tbody>
1415
<tr th:each="item : ${items}">
1516
<td th:text="${item.id}"></td>
1617
<td th:text="${item.name}"></td>
1718
<td th:text="${item.price}"></td>
1819
<td><a th:href="@{'/add/' + ${item.id}}">Add to Cart</a></td>
1920
<td><a th:href="@{'/delete/' + ${item.id}}">Delete</a></td>
2021
</tr>
22+
</tbody>
2123
</table>
2224
<!-- end::1[] -->
2325

24-
<!--<h3>Add New Inventory</h3>-->
25-
<!--<form method="post" action="/">-->
26-
<!--<input name="name" type="text" />-->
27-
<!--<input name="price" type="text" />-->
28-
<!--<input type="submit" />-->
29-
<!--</form>-->
30-
3126
<!-- tag::2[] -->
3227
<h2>My Cart</h2>
3328
<table>
34-
<th>Id</th><th>Name</th><th>Quantity</th>
29+
<thead><tr><th>Id</th><th>Name</th><th>Quantity</th></tr></thead>
30+
<tbody>
3531
<tr th:each="cartItem : ${cart.cartItems}">
3632
<td th:text="${cartItem.item.id}"></td>
3733
<td th:text="${cartItem.item.name}"></td>
3834
<td th:text="${cartItem.quantity}"></td>
3935
</tr>
36+
</tbody>
4037
</table>
4138
<!-- end::2[] -->
4239

3-reactive/src/main/resources/templates/home.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,31 @@ <h1>Welcome to Hacking with Spring Boot!</h1>
1010
<!-- tag::1[] -->
1111
<h2>Inventory Management</h2>
1212
<table>
13-
<th>Id</th><th>Name</th><th>Price</th>
13+
<thead><tr><th>Id</th><th>Name</th><th>Price</th></tr></thead>
14+
<tbody>
1415
<tr th:each="item : ${items}">
1516
<td th:text="${item.id}"></td>
1617
<td th:text="${item.name}"></td>
1718
<td th:text="${item.price}"></td>
1819
<td><a th:href="@{'/add/' + ${item.id}}">Add to Cart</a></td>
1920
<td><a th:href="@{'/delete/' + ${item.id}}">Delete</a></td>
2021
</tr>
22+
</tbody>
2123
</table>
2224
<!-- end::1[] -->
2325

2426
<!-- tag::2[] -->
2527
<h2>My Cart</h2>
2628
<table>
27-
<th>Id</th><th>Name</th><th>Quantity</th>
29+
<thead><tr><th>Id</th><th>Name</th><th>Quantity</th></tr></thead>
30+
<tbody>
2831
<tr th:each="cartItem : ${cart.cartItems}">
2932
<td th:text="${cartItem.item.id}"></td>
3033
<td th:text="${cartItem.item.name}"></td>
3134
<td th:text="${cartItem.quantity}"></td>
3235
<td><a th:href="@{'/remove/' + ${cartItem.item.id}}">-1</a></td>
3336
</tr>
37+
</tbody>
3438
</table>
3539
<!-- end::2[] -->
3640

4-reactive/src/main/resources/templates/home.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,31 @@ <h1>Welcome to Hacking with Spring Boot!</h1>
1010
<!-- tag::1[] -->
1111
<h2>Inventory Management</h2>
1212
<table>
13-
<th>Id</th><th>Name</th><th>Price</th>
13+
<thead><tr><th>Id</th><th>Name</th><th>Price</th></tr></thead>
14+
<tbody>
1415
<tr th:each="item : ${items}">
1516
<td th:text="${item.id}"></td>
1617
<td th:text="${item.name}"></td>
1718
<td th:text="${item.price}"></td>
1819
<td><a th:href="@{'/add/' + ${item.id}}">Add to Cart</a></td>
1920
<td><a th:href="@{'/delete/' + ${item.id}}">Delete</a></td>
2021
</tr>
22+
</tbody>
2123
</table>
2224
<!-- end::1[] -->
2325

2426
<!-- tag::2[] -->
2527
<h2>My Cart</h2>
2628
<table>
27-
<th>Id</th><th>Name</th><th>Quantity</th>
29+
<thead><tr><th>Id</th><th>Name</th><th>Quantity</th></tr></thead>
30+
<tbody>
2831
<tr th:each="cartItem : ${cart.cartItems}">
2932
<td th:text="${cartItem.item.id}"></td>
3033
<td th:text="${cartItem.item.name}"></td>
3134
<td th:text="${cartItem.quantity}"></td>
3235
<td><a th:href="@{'/remove/' + ${cartItem.item.id}}">-1</a></td>
3336
</tr>
37+
</tbody>
3438
</table>
3539
<!-- end::2[] -->
3640

5-reactive/src/main/resources/templates/home.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,31 @@ <h1>Welcome to Hacking with Spring Boot!</h1>
1010
<!-- tag::1[] -->
1111
<h2>Inventory Management</h2>
1212
<table>
13-
<th>Id</th><th>Name</th><th>Price</th>
13+
<thead><tr><th>Id</th><th>Name</th><th>Price</th></tr></thead>
14+
<tbody>
1415
<tr th:each="item : ${items}">
1516
<td th:text="${item.id}"></td>
1617
<td th:text="${item.name}"></td>
1718
<td th:text="${item.price}"></td>
1819
<td><a th:href="@{'/add/' + ${item.id}}">Add to Cart</a></td>
1920
<td><a th:href="@{'/delete/' + ${item.id}}">Delete</a></td>
2021
</tr>
22+
</tbody>
2123
</table>
2224
<!-- end::1[] -->
2325

2426
<!-- tag::2[] -->
2527
<h2>My Cart</h2>
2628
<table>
27-
<th>Id</th><th>Name</th><th>Quantity</th>
29+
<thead><tr><th>Id</th><th>Name</th><th>Quantity</th></tr></thead>
30+
<tbody>
2831
<tr th:each="cartItem : ${cart.cartItems}">
2932
<td th:text="${cartItem.item.id}"></td>
3033
<td th:text="${cartItem.item.name}"></td>
3134
<td th:text="${cartItem.quantity}"></td>
3235
<td><a th:href="@{'/remove/' + ${cartItem.item.id}}">-1</a></td>
3336
</tr>
37+
</tbody>
3438
</table>
3539
<!-- end::2[] -->
3640

9-reactive-quick/src/main/resources/templates/home.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,31 @@ <h1>Welcome to Hacking with Spring Boot!</h1>
1010
<!-- tag::1[] -->
1111
<h2>Inventory Management</h2>
1212
<table>
13-
<th>Id</th><th>Name</th><th>Price</th>
13+
<thead><tr><th>Id</th><th>Name</th><th>Price</th></tr></thead>
14+
<tbody>
1415
<tr th:each="item : ${items}">
1516
<td th:text="${item.id}"></td>
1617
<td th:text="${item.name}"></td>
1718
<td th:text="${item.price}"></td>
1819
<td><a th:href="@{'/add/' + ${item.id}}">Add to Cart</a></td>
1920
<td><a th:href="@{'/delete/' + ${item.id}}">Delete</a></td>
2021
</tr>
22+
</tbody>
2123
</table>
2224
<!-- end::1[] -->
2325

2426
<!-- tag::2[] -->
2527
<h2>My Cart</h2>
2628
<table>
27-
<th>Id</th><th>Name</th><th>Quantity</th>
29+
<thead><tr><th>Id</th><th>Name</th><th>Quantity</th></tr></thead>
30+
<tbody>
2831
<tr th:each="cartItem : ${cart.cartItems}">
2932
<td th:text="${cartItem.item.id}"></td>
3033
<td th:text="${cartItem.item.name}"></td>
3134
<td th:text="${cartItem.quantity}"></td>
3235
<td><a th:href="@{'/remove/' + ${cartItem.item.id}}">-1</a></td>
3336
</tr>
37+
</tbody>
3438
</table>
3539
<!-- end::2[] -->
3640

9-reactive-repository/src/main/resources/templates/home.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,31 @@ <h1>Welcome to Hacking with Spring Boot!</h1>
1010
<!-- tag::1[] -->
1111
<h2>Inventory Management</h2>
1212
<table>
13-
<th>Id</th><th>Name</th><th>Price</th>
13+
<thead><tr><th>Id</th><th>Name</th><th>Price</th></tr></thead>
14+
<tbody>
1415
<tr th:each="item : ${items}">
1516
<td th:text="${item.id}"></td>
1617
<td th:text="${item.name}"></td>
1718
<td th:text="${item.price}"></td>
1819
<td><a th:href="@{'/add/' + ${item.id}}">Add to Cart</a></td>
1920
<td><a th:href="@{'/delete/' + ${item.id}}">Delete</a></td>
2021
</tr>
22+
</tbody>
2123
</table>
2224
<!-- end::1[] -->
2325

2426
<!-- tag::2[] -->
2527
<h2>My Cart</h2>
2628
<table>
27-
<th>Id</th><th>Name</th><th>Quantity</th>
29+
<thead><tr><th>Id</th><th>Name</th><th>Quantity</th></tr></thead>
30+
<tbody>
2831
<tr th:each="cartItem : ${cart.cartItems}">
2932
<td th:text="${cartItem.item.id}"></td>
3033
<td th:text="${cartItem.item.name}"></td>
3134
<td th:text="${cartItem.quantity}"></td>
3235
<td><a th:href="@{'/remove/' + ${cartItem.item.id}}">-1</a></td>
3336
</tr>
37+
</tbody>
3438
</table>
3539
<!-- end::2[] -->
3640

0 commit comments

Comments
 (0)