teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

CSSの編集に変更しました

2020/11/21 03:54

投稿

A-pZ
A-pZ

スコア12011

answer CHANGED
@@ -1,13 +1,29 @@
1
- th:eachを記述する場所に誤りがあのではないかと
1
+ flex利用可能でれば、次ようにCSSを指定すれば可能
2
- 今のままでは、shopInfoListの要素数だけ<table>が出力されてしまいます。
3
2
 
3
+ ```css
4
+ .chart-graph{
4
- th:eachは繰り返して出力したい要素に記述します。
5
+ height:30vh;
6
+ width: 40vw;
7
+ }
5
8
 
9
+ .box {
10
+ display: flex;
11
+ }
12
+ ```
13
+
6
14
  ```html
7
- <tbody>
15
+ <div class="container">
8
- <tr th:each="obj2 : ${shopInfoList}">
16
+ <div th:each="obj2 : ${shopInfoList}" class="box">
17
+ <div class="alt-table-responsive">
9
- <td th:text="テスト"></td>
18
+ <table class="table table-striped">
19
+ ....
10
- <td th:text="テスト"></td>
20
+ </table>
11
- </tr>
21
+ </div>
22
+ <div class="chart-graph">
23
+ <canvas th:id=${obj2.pastChartId}></canvas>
12
- ...
24
+ ....
13
- ```
25
+ ```
26
+
27
+ 適宜、.alt-table-responsiveやtableでのサイズ指定を調整してください。
28
+
29
+ ![イメージ説明](8424f52ad30cade2db6ffbad468c05f7.png)