質問編集履歴

1

内容変更

2019/11/21 22:39

投稿

ai9376451
ai9376451

スコア15

test CHANGED
@@ -1 +1 @@
1
- Spring 拡張for文th:each属性で長すぎる分ときの対応につ
1
+ Spring 拡張for文th:each属性の表示がうまくかない
test CHANGED
@@ -1,116 +1,72 @@
1
- Spring Bootで下記のコードを書くと、横一列で表示されますが、
1
+ Spring Bootで下記のコードを書くと、横一列で表示されますが、![イメージ説明](8726d16361588085fdb1ff2523fd690b.png)
2
-
3
- それを、テーブルのように表示は可能でしょうか?
4
-
5
- 試してみましたが、エラーになってしまいます。
6
2
 
7
3
 
8
4
 
9
5
 
10
6
 
11
- 表示したい形
7
+
12
8
 
13
9
  ```
14
10
 
15
- <table>
11
+ <!DOCTYPE html>
16
12
 
17
- <tbody>
13
+ <html xmlns:th="http://www.thymeleaf.org">
18
14
 
19
- <tr>
15
+ <head>
20
16
 
21
- <td colspan="2"></td>
17
+ <meta charset="UTF-8" />
22
18
 
23
- <td colspan="6"></td>
19
+
24
20
 
25
- </tr>
21
+ <title>日誌登録</title>
26
22
 
27
- <tr>
23
+ </head>
28
24
 
29
- <td colspan="2"></td>
25
+ <h1>日誌登録</h1>
30
26
 
31
- <td colspan="2"></td>
27
+
32
28
 
33
- <td colspan="2"></td>
29
+ </head>
34
30
 
35
- <td colspan="2"></td>
31
+ <body>
36
32
 
37
- </tr>
33
+ <h1 class="text-center table table-hover ">日誌一覧</h1>
38
34
 
39
- <tr>
35
+ <table border="1" class="table table-striped ">
40
36
 
41
- <td colspan="2"></td>
37
+ <tr>
42
38
 
43
- <td colspan="6"></td>
39
+ <th class="text-center">id</th>
44
40
 
45
- </tr>
41
+ <th class="text-center">園児番号</th>
46
42
 
47
- <tr>
43
+ <th colspan="3" class="text-center">園児の名前</th>
48
44
 
49
- <td colspan="2"></td>
45
+ <th class="text-center">睡眠開始時間</th>
50
46
 
51
- <td colspan="6"></td>
47
+ <th class="text-center">睡眠終了時間</th>
52
48
 
53
- </tr>
49
+ <th class="text-center">機嫌</th>
54
50
 
55
- <tr>
51
+ <th class="text-center">排便</th>
56
52
 
57
- <td colspan="2"></td>
53
+ <th class="text-center">食事</th>
58
54
 
59
- <td colspan="6"></td>
55
+ <th class="text-center">1日の様子</th>
60
56
 
61
- </tr>
57
+ <th class="text-center">お迎え時間</th>
62
58
 
63
- <tr>
59
+ <th class="text-center">伝達事項</th>
64
60
 
65
- <td colspan="2"></td>
61
+ <th class="text-center">記入者</th>
66
62
 
67
- <td colspan="6"></td>
63
+ <th class="text-center">日付</th>
68
64
 
69
- </tr>
65
+
70
66
 
71
- <tr>
67
+ </tr>
72
68
 
73
- <td colspan="2"></td>
74
-
75
- <td colspan="6"></td>
76
-
77
- </tr>
78
-
79
- <tr>
80
-
81
- <td colspan="2"></td>
82
-
83
- <td colspan="6"></td>
84
-
85
- </tr>
86
-
87
- <tr>
88
-
89
- <td colspan="2"></td>
90
-
91
- <td colspan="6"></td>
92
-
93
- </tr>
94
-
95
- <tr>
96
-
97
- <td colspan="2"></td>
98
-
99
- <td colspan="6"></td>
100
-
101
- </tr>
102
-
103
- </tbody>
104
-
105
- </table>
106
-
107
- ```
108
-
109
-
110
-
111
- ```ここに言語を入力
112
-
113
- <tr th:each="nissi: ${teacherNissilistt}">
69
+ <tr th:each="nissi: ${teacherNissilist}">
114
70
 
115
71
  <td th:text="${nissi.id}">
116
72
 
@@ -128,12 +84,46 @@
128
84
 
129
85
  <td th:text="${nissi.meal}">
130
86
 
131
- <td th:text="${nissi.phase}">
87
+ <td th:text="${nissi.phase}">
88
+
89
+ <td th:text="${nissi.pickuptime}">
132
90
 
133
91
  <td th:text="${nissi.communication}">
134
92
 
135
93
  <td th:text="${nissi.daybookwriter}">
136
94
 
137
- <td th:text="${nissi.writedate}">
95
+ <td th:text="${nissi.writedate}">
96
+
97
+
98
+
99
+
100
+
101
+ </td></tr></body>
102
+
103
+ <form th:action="@{/teacher-nissi-end}" th:object="${insertMogipuroForm}" >
104
+
105
+ <input type="submit" name="back_btn" value="日記登録" />
106
+
107
+ <input type="submit" name="nissi_btn" value="戻る" />
108
+
109
+ </form>
110
+
111
+ </html>
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
138
124
 
139
125
  ```
126
+
127
+
128
+
129
+ ![イメージ説明](98206ed71d62e634708d9060befc4d0d.png)