電子書籍の厳選無料作品が豊富!

テーブルを右寄せに置いて、
その横に少しスペースを空けたいのですが…
どこにどのタグを入れたらよいでしょうか?
使用しているタグは
<Table Border>
<Tr>
<Td>
文字</Td>
</Tr>
</Table>
この形の物です。

A 回答 (5件)

難しく考えないで、<TABLE> と入れれば半角分のスペースが出来ます。


いくつ入れても構いません。
    • good
    • 0

No1です


No2さんの回答で良いと思いますが

th, td, table に font:12px/120% serif,Times; を指定した方が良いと思います 作成画面のインチが異なると <Font Size="1"> 指定だと表示が異なりますので

それから趣味の相違か padding: は、使用しないで margin を使用しています

<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>
では、無く
<th><a href="URL">リンク文字</a></th><th><Font Color="カラーコード">文字</Font></th><th><Font Color="カラーコード">文字</Font></th><th><Font Color="カラーコード">文字</Font></th><th><a href="URL">リンク文字</a></th> ・・・

と思いますが
    • good
    • 0

とりあえず最後のタグの閉め方がおかしいと思いましたが・・・。


</Center></Table><tr></tb></Div>

</Center></td></tr></Table></Div>

tableタグに「style="margin-right:15px;"」を付けると表の枠の外の右側に余白が空きます。
tdにつけると枠内の文字の右側に余白が出来ます。

<Div Align="right">
<table cellpadding="10" bgcolor=#000000 Width="180" Height="100" style="margin-right:15px;">
<tr><td style="margin-right:15px;">
<Center><Font Size="1">
<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>
<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>
<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>
<Font Color="URL">文字</Font>文字<a href="URL">文字</a>文字<Font Color="カラーコード">文字</Font>
<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>

</Center>
</td></tr></Table>
</Div>
    • good
    • 0

<style type="text/css">


#main
{
width:700px;
}
table
{
float:right;
width:500px;
}
th, td, table
{
border:4px outset #000000;
padding: 2px 10px;
}
th
{
color: green;
}
td
{
color: red;
}
</style>

<div id="main">
<table >
<tr>
<th>テストです
</th>
<th>テストです
</th>
<th>テストです
</th>
<th>テストです
</th>
</tr>

<tr>
<th>テストです
</th>
<td>テストです
</td>
<td>テストです
</td>
<td>テストです
</td>

</tr>

<tr>
<th>テストです
</th>
<td>テストです
</td>
<td>テストです
</td>
<td>テストです
</td>

</tr>

<tr>
<th>テストです
</th>
<td>テストです
</td>
<td>テストです
</td>
<td>テストです
</td>

</tr>
</table>
テストテストテストテストテストテストテストテスト

</div>
横幅固定ならこの様にすれば良いと思います。
#mainとtableのwidthをパーセントで指定すれば伸び縮みが出来ます。
    • good
    • 0

<margin-right>属性により右のマージンの指定を設定する。



作成例
<Td style="margin-right:18px;">
文字</Td>

又は、セルにwidth指定をする
作成例
<col span="3" style="width:216px;"><tbody>

参考URL:http://www.tohoho-web.com/css/reference.htm#margin
    • good
    • 0
この回答へのお礼

回答有難う御座います。

<Div Align="right"><table cellpadding="10" bgcolor=#000000 Width="180" Height="100"><tr><td style="margin-right:15px;"><Center><Font Size="1">
<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>
<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>
<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>
<Font Color="URL">文字</Font>文字<a href="URL">文字</a>文字<Font Color="カラーコード">文字</Font>
<a href="URL">リンク文字</a><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><Font Color="カラーコード">文字</Font><a href="URL">リンク文字</a>

</Center></Table><tr></tb></Div>

非常にややこしいですが
このように作ってみました。
ですが、横のスペースは反映されていませんでした。
何か良い方法はありませんか?

お礼日時:2007/11/03 00:02

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!