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

回答編集履歴

3

edit

2020/09/08 10:23

投稿

m.ts10806
m.ts10806

スコア80888

answer CHANGED
@@ -9,8 +9,4 @@
9
9
  <tr th:each="list : ${list}" th:classappend="${list.eFlg =='1'} ? 'bg-green'">
10
10
  ```
11
11
 
12
- インラインスタイルはあまり望ましくないのでクラスにしましたけど、
12
+ インラインスタイルはあまり望ましくないのでクラスにしました
13
- 案外これでもいけるんじゃないかと思ってみたり(未検証)
14
- ```Thymeleaf
15
- <tr th:each="list : ${list}" th:style="${list.eFlg =='1'} ? 'background-color: #00ff00;'">
16
- ```

2

追記

2020/09/08 10:23

投稿

m.ts10806
m.ts10806

スコア80888

answer CHANGED
@@ -4,7 +4,13 @@
4
4
  tr.bg-green{
5
5
  background-color: #00ff00;
6
6
  }
7
+ ```
8
+ ```Thymeleaf
9
+ <tr th:each="list : ${list}" th:classappend="${list.eFlg =='1'} ? 'bg-green'">
10
+ ```
7
11
 
12
+ インラインスタイルはあまり望ましくないのでクラスにしましたけど、
13
+ 案外これでもいけるんじゃないかと思ってみたり(未検証)
8
14
  ```Thymeleaf
9
- <tr th:each="list : ${list}" th:classappend="${list.eFlg =='1'} ? 'bg-green'">
15
+ <tr th:each="list : ${list}" th:style="${list.eFlg =='1'} ? 'background-color: #00ff00;'">
10
16
  ```

1

修正

2020/09/08 10:20

投稿

m.ts10806
m.ts10806

スコア80888

answer CHANGED
@@ -1,1 +1,10 @@
1
- CSSのクラス作ってclassappendのほうが良いように思います。
1
+ CSSのクラス作ってclassappendのほうが良いように思います。
2
+
3
+ ```css
4
+ tr.bg-green{
5
+ background-color: #00ff00;
6
+ }
7
+
8
+ ```Thymeleaf
9
+ <tr th:each="list : ${list}" th:classappend="${list.eFlg =='1'} ? 'bg-green'">
10
+ ```