サイト内検索

...HTML・XHTMLタグ...

table・セル

セル内の余白

セル内の空白(空間)は、table要素にcellpadding属性を指定します。
[使い方]
<table border="1" cellpadding="0">
cellpadding="" 整数の「ピクセル数(例・・"1")」
または
「パーセント(例・・"50%")」を指定します。

サンプル

《「cellpadding」の数値を「0」に指定した場合》

[bodyの中]

<table border="1" cellpadding="0">
<tr>
<th>No</th>
<th>No</th>
</tr>
<tr>
<td>No</td>
<td>No</td>
</tr>
</table>

[ブラウザ上]

NoNo
NoNo

《「cellpadding」の数値を「10」に指定した場合》

[bodyの中]

<table border="1" cellpadding="10">
<tr>
<th>No</th>
<th>No</th>
</tr>
<tr>
<td>No</td>
<td>No</td>
</tr>
</table>

[ブラウザ上]

NoNo
NoNo

Copyright c 2007.10.01 luc All rights reserved.