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

回答編集履歴

1

追加

2018/10/10 01:21

投稿

yoshinavi
yoshinavi

スコア3525

answer CHANGED
@@ -7,4 +7,40 @@
7
7
 
8
8
  HTML5は、セマンティックHTMLとなりますので、現状のコードでCSSで表に見せかけるより、<table>タグで作成された方が良いかと思います。
9
9
 
10
- 各セルの装飾等はHTMLタグは非推奨になっていますので、CSSで設定してください。<table>タグそのものが非推奨になっている訳ではありません。
10
+ 各セルの装飾等はHTMLタグは非推奨になっていますので、CSSで設定してください。<table>タグそのものが非推奨になっている訳ではありません。
11
+ ***
12
+ <table>タグの1例
13
+ ※<thead><tbody>は、省略可能なので、無くても良いです。
14
+ ```HTML
15
+ <table>
16
+ <thead>
17
+ <tr class="Header">
18
+ <th class="sokutei">測定日</th>
19
+ <th class="weather">天気</th>
20
+ <th class="temp">温度</th>
21
+ <th class="humid">湿度</th>
22
+ <th class="tanntou">担当者</th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr class="Value">
27
+ <td class="sokutei">12/1</td>
28
+ <td class="weather">晴れ</td>
29
+ <td class="temp"></td>
30
+ <td class="humid"></td>
31
+ <td class="tanntou">タナカ</td>
32
+ </tr>
33
+ </tbody>
34
+ </table>
35
+ ```
36
+ ```CSS
37
+ table {
38
+ border-collapse: collapse;
39
+ }
40
+
41
+ table th,
42
+ table td {
43
+ border: solid 1px #000;
44
+ width: 300px;
45
+ }
46
+ ```