背景色の変え方は2通り解釈できます。
[1]<table></table>の中身の背景色を全て変える。
[2]<tr>,<td>,<th>の中身の背景色だけ変える。

[1][2]もbgcolor=""を使うのですが、指定するところが違います。
それぞれ適用したい箇所に入れて下さい。

一応それぞれ試してみます。
赤字が適用した箇所です。
[1]のケース
<table border="1" bgcolor="aqua">
<tr>
<th>データ1</th>
<th>データ2</th>
</tr>
<tr>
<td>データ3</td>
<td>データ4</td>
</tr>
</table>

データ1データ2
データ3データ4

[2]のケース
trとtdにそれぞれ適用してみます。
<table border="1">
<tr bgcolor="aqua">
<th>データ1</th>
<th>データ2</th>
</tr>
<tr>
<td bgcolor="aqua">データ3</td>
<td>データ4</td>
</tr>
</table>

データ1データ2
データ3データ4

☆画像を入れたいケース
<table border="1">
<tr background="table.jpg">
<th>データ1</th>
<th>データ2</th>
</tr>
<tr>
<td background="table.jpg">データ3</td>
<td>データ4</td>
</tr>
</table>

データ1データ2
データ3データ4

とこんな感じです。
よく分からない方は列の並べ方をご覧になって下さい。

[MENUに戻る]
[HOME]