cssを使ったテーブルを反映してみると、別ページで使用しているテーブルのthとtdが反映してしまいます。
テーブルを複数使いたい場合、下記のコードはどのように指定すればよいのでしょうか?
html
1<table summary="会社案内表"> 2 <tr> 3 <th class="t_top" width="180">会社名</th> 4 <td class="t_top">株式会社○○○</td> 5 </tr> 6 <tr> 7 <th>代表者名</th> 8 <td>山本 太郎</td> 9 </tr> 10 <tr> 11 <th>所在地</th> 12 <td>〒000-0000 東京都新宿区西新宿00-00</td> 13 </tr> 14 <tr> 15 <th>電話番号</th> 16 <td>000-0000-0000</td> 17 </tr> 18 <tr> 19 <th>メールアドレス</th> 20 <td>000@000.com</td> 21 </tr> 22</table>
css
1table { 2 border-collapse: collapse; 3 width:100%; 4} 5th.t_top { 6 border-top: #be1309 4px solid; 7} 8th { 9 border-bottom: #e3e3e3 1px dotted; 10 text-align: left; 11 padding: 10px; 12 font-weight: normal; 13} 14td.t_top { 15 border-top: #b3b3b3 4px solid; 16} 17td { 18 border-bottom: #e3e3e3 1px dotted; 19 text-align: left; 20 padding: 10px; 21} 22tr:hover { 23 background: #3D80DF; 24 color: #FFFFFF; 25}
他ページに指定しているcss↓
css
1table { 2 border: 1px solid black; 3 margin: auto; 4 padding-left: 50px; 5 6} 7td { 8 border: none; 9 10} 11th { 12 border: none; 13 14} 15td { 16 height: 200px; 17 width: 300px; 18 font-size: 14px; 19 line-height: 1.7em; 20 color: #1c1c1c; 21 text-align: left 22 } 23 24 25th { 26 width: 500px; 27 height: 200px; 28 font-size: 14px; 29 line-height: 1.7em; 30 color: #1c1c1c; 31 text-align: left; 32 font-weight:normal; 33 34}

回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。