サイト内検索

...HTML・XHTMLタグ...

table

テキストの位置の指定(回り込み)

表の配置とその後に続くテキストの揃え方は、table要素にalign属性を指定します。
[使い方]
<table align="center">
[メモ・・・W3Cの検証サービス・・・]
HTML 4.01 Strict ・ XHTML1.0 Strictでは、推奨されていませんので、
Validするには、スタイルシートを使用します。
float(左右の位置)プロパティmarginプロパティ指定します。
[サンプル]
.sample{float: left; margin-left: auto;}
属性 属性値 説明
align= "left"表の右側にテキストを表示します。
"center"表を中央に表示します。
"right"表の左側にテキストを表示します。

サンプル

《align="left" の場合》

[bodyの中]

<table border="1" align="left" width="150" height="70">
<tr>
<th>No</th>
<th>No</th>
</tr>
<tr>
<td>No</td>
<td>No</td>
</tr>
</table>
align="left"
を設定
しています

float・marginを指定

[bodyの中]

<table border="1"
style="float:left; margin-right:50px; height: 70px;" width="150">
<tr>
<th>No</th>
<th>No</th>
</tr>
<tr>
<td>No</td>
<td>No</td>
</tr>
</table>
float:left; margin-left:auto;

指定しています

[ブラウザ上]

NoNo
NoNo
float:left; margin-left:auto;

指定しています

Copyright c 2007.10.01 luc All rights reserved.