サイト内検索
...HTML・XHTMLタグ...
table
回りこみの解除
- 回りこみを解除するには、br要素にclear属性を指定します。
- [使い方]
- <br clear="all">
- [メモ・・・W3Cの検証サービス・・・]
- HTML 4.01 Strict ・ XHTML1.0 Strictでは、推奨されていませんので、
- Validするには、スタイルシートを使用します。
- clearプロパティを指定します。
- .sample{clear: both:}
属性 | 属性値 | 説明 |
---|---|---|
clear= | "left" | 表の右側にあるテキストの回り込みを解除します。 |
"right" | 表の左側にあるテキストの回り込みを解除します。 | |
"all" | どちらの回り込みも解除します。 |
サンプル
[bodyの中]
<table border="1" align="left" width="200" height="70"><tr>
<th>No1</th>
<th>No2</th>
</tr>
<tr>
<td>No3</td>
<td>No4</td>
</tr>
</table>
align="left"を指定します。
<br clear="all">
br clear="all" を使って、回り込みを解除します。
clear: both:を指定
[bodyの中]
<table border="1" style="float:left; margin-left:auto; height: 70px;" width="200"><tr>
<th>No1</th>
<th>No2</th>
</tr>
<tr>
<td>No3</td>
<td>No4</td>
</tr>
</table>
「float:left; margin-left:auto;」
を
指定しています。
<br style="clear: both;">
を指定して、回り込みを解除します。
[ブラウザ上]
No1 | No2 |
---|---|
No3 | No4 |
を
指定しています。
<br style="clear: both;">
を指定して、回り込みを解除します。