tableの中に更にtableを作りたいのですが、内側のtableが上のほうに配置されず真ん中に出てしまいます。valign=topを使ったのですがうまくいきません。何か方法はありますでしょうか?
<table height=500>
<tr><td>
---------- ここと ------------
<table height=250> <tr><td></td></tr>
<tr><td></td></tr>
</table>
---------- ここにかなりスペースが出来てしまう(*_*)
</tr></td>
</table>
A 回答 (6件)
- 最新から表示
- 回答順に表示
No.1
- 回答日時:
<table height=500>
<tr><td valign="top">
---------- ここと ------------
valign で上になると思いますが?
この回答への補足
実際のタグはこんな感じなんですが、bgcolor=#ffffffの中の6個の
table(box)をより近づけたいのですが・・・ 素人なものでご教授ください。
<HTML>
<HEAD>
<TITLE>sample</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-sjis">
<BODY bgcolor=#000000 topmargin="0">
</head>
</HEAD>
<table width=592 align=center CELLPADDING=0 CELLSPACING=0 valign=top>
<tr><td bgcolor=#000000>
<TABLE WIDTH=592 BORDER=0 CELLPADDING=0 CELLSPACING=0 valign=top>
<TR><TD><A Href="../index.html"><Img Src="logo1.jpg" Width="592" Height="30" border=0></A></td></TR>
<TR><TD><Img Src="logo3_01.jpg" Width="102" Height="26" border=0><Img Src="logo3_02.jpg" Width="99" Height="26" border=0><Img Src="logo3_03.jpg" Width="99" Height="26" border=0><Img Src="logo3_04.jpg" Width="100" Height="26" border=0><Img Src="logo3_05.jpg" Width="91" Height="26" border=0><Img Src="logo3_06.jpg" Width="101" Height="26" border=0></TD></TR>
<TR><TD Width="592" Height="401"><Img Src="mame2_01.jpg" Width="592" Height="401"></TD></TR>
<TR><TD WIDTH=592 valign=top bgcolor=#ffffff>
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top >
<!-- 1 -->
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A valign=top></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887 valign=top><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A valign=top></Td></Tr>
<Tr><Td colspan=2 valign=top><br></Td></Tr>
</table>
<!-- 2 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 3 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 4 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 5 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</Table>
<!-- 6 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</Table>
</td></tr>
</table>
</BODY>
</HTML>
No.2
- 回答日時:
<tr>と<td>がタグが反対です。
インデントをきっちり付けないとミスが増えますよ。
<table height=500 border="1">
<tr>
<td valign="top">
<table height=250 border="1">
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
この回答への補足
実際のタグはこんな感じなんですが、bgcolor=#ffffffの中の6個の
table(box)をより近づけたいのですが・・・ 素人なものでご教授ください。
<HTML>
<HEAD>
<TITLE>sample</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-sjis">
<BODY bgcolor=#000000 topmargin="0">
</head>
</HEAD>
<table width=592 align=center CELLPADDING=0 CELLSPACING=0 valign=top>
<tr><td bgcolor=#000000>
<TABLE WIDTH=592 BORDER=0 CELLPADDING=0 CELLSPACING=0 valign=top>
<TR><TD><A Href="../index.html"><Img Src="logo1.jpg" Width="592" Height="30" border=0></A></td></TR>
<TR><TD><Img Src="logo3_01.jpg" Width="102" Height="26" border=0><Img Src="logo3_02.jpg" Width="99" Height="26" border=0><Img Src="logo3_03.jpg" Width="99" Height="26" border=0><Img Src="logo3_04.jpg" Width="100" Height="26" border=0><Img Src="logo3_05.jpg" Width="91" Height="26" border=0><Img Src="logo3_06.jpg" Width="101" Height="26" border=0></TD></TR>
<TR><TD Width="592" Height="401"><Img Src="mame2_01.jpg" Width="592" Height="401"></TD></TR>
<TR><TD WIDTH=592 valign=top bgcolor=#ffffff>
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top >
<!-- 1 -->
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A valign=top></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887 valign=top><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A valign=top></Td></Tr>
<Tr><Td colspan=2 valign=top><br></Td></Tr>
</table>
<!-- 2 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 3 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 4 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 5 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</Table>
<!-- 6 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</Table>
</td></tr>
</table>
</BODY>
</HTML>
No.3
- 回答日時:
tableタグにcellpadding="0"とcellspacing="0"を追加して下さい。
<table cellpadding="0" cellspacing="0">
この回答への補足
実際のタグはこんな感じなんですが、bgcolor=#ffffffの中の6個の
table(box)をより近づけたいのですが・・・ 素人なものでご教授ください。
<HTML>
<HEAD>
<TITLE>sample</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-sjis">
<BODY bgcolor=#000000 topmargin="0">
</head>
</HEAD>
<table width=592 align=center CELLPADDING=0 CELLSPACING=0 valign=top>
<tr><td bgcolor=#000000>
<TABLE WIDTH=592 BORDER=0 CELLPADDING=0 CELLSPACING=0 valign=top>
<TR><TD><A Href="../index.html"><Img Src="logo1.jpg" Width="592" Height="30" border=0></A></td></TR>
<TR><TD><Img Src="logo3_01.jpg" Width="102" Height="26" border=0><Img Src="logo3_02.jpg" Width="99" Height="26" border=0><Img Src="logo3_03.jpg" Width="99" Height="26" border=0><Img Src="logo3_04.jpg" Width="100" Height="26" border=0><Img Src="logo3_05.jpg" Width="91" Height="26" border=0><Img Src="logo3_06.jpg" Width="101" Height="26" border=0></TD></TR>
<TR><TD Width="592" Height="401"><Img Src="mame2_01.jpg" Width="592" Height="401"></TD></TR>
<TR><TD WIDTH=592 valign=top bgcolor=#ffffff>
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top >
<!-- 1 -->
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A valign=top></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887 valign=top><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A valign=top></Td></Tr>
<Tr><Td colspan=2 valign=top><br></Td></Tr>
</table>
<!-- 2 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 3 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 4 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</table>
<!-- 5 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</Table>
<!-- 6 -->
<Table width=560 Border=1 Align=center CellSpacing=0 CellPadding=5 valign=top>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td Height="18" colspan=3 bgcolor=#DEB887><Font Color="#A52A2A"><b>【質問】</b> </Td></Tr>
<Tr><Td Height="2" colspan=3 bgcolor=#A52A2A></Td></Tr>
<Tr><Td colspan=2><br></Td></Tr>
</Table>
</td></tr>
</table>
</BODY>
</HTML>
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
似たような質問が見つかりました
- HTML・CSS テーブルタグのセルの幅の一部だけを指定 1 2023/03/12 12:02
- AJAX JavascriptからPHPへのAjax通信でnullが返ってくる 3 2022/08/03 22:00
- Visual Basic(VBA) Selenium.ChromeDriverの使い方について 7 2022/09/22 06:43
- JavaScript EasyUIのSubGrid(jquery)におけるObjectに入れた連想配列について 1 2022/05/02 11:21
- HTML・CSS 自身のHPにYouTube動画を貼り付けるのが出来なくなり困ってます 1 2022/11/11 10:44
- PHP htmlで複数の個数入力欄を表示させるには 1 2022/09/20 03:11
- JavaScript 追加ボタンを押した際に ok ボタンを押した場合のみ入力値が追記されるようにしたいです 6 2022/05/29 09:57
- HTML・CSS 【CSS】:hasで可能? imgを含むtr要素を選択したい 1 2022/11/17 14:36
- その他(プログラミング・Web制作) python 気象データの取得 2 2023/06/20 23:54
- JavaScript jQueryで同じクラス名のものを別物として扱いたい 1 2022/06/17 14:14
関連するカテゴリからQ&Aを探す
おすすめ情報
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
テーブルの行を折りたたみたい...
-
tableにul,または,olを入れられ...
-
TRタグの余白をcssで設定するには
-
cssで、表示されるテキストによ...
-
テーブルの任意の列を非表示に...
-
テーブルのセルに画像をピッタ...
-
文字列が入っているtdを削除せ...
-
テーブルの表示がずれます
-
テーブルタグのセルの幅の一部...
-
スタイルシートで colspan=3と...
-
テーブルを挿入すると他のCSSと...
-
テーブルのヘッダとボディの幅...
-
EXCELのセル内にHTMLタグを含む...
-
javascriptを使って、指定行以...
-
ASP GridViewで1レコード2行を...
-
HTML <td></td>タグ セル内余...
-
<span>の中では折り返さないに...
-
文字の中央そろえを一括で指定...
-
幅の違うテーブルを作りたい
-
テーブル内でdivを使った時に改...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
TRタグの余白をcssで設定するには
-
tableにul,または,olを入れられ...
-
テーブルの任意の列を非表示に...
-
テーブルのヘッダとボディの幅...
-
cssで、表示されるテキストによ...
-
HTML <td></td>タグ セル内余...
-
文字列が入っているtdを削除せ...
-
テーブルのセルに画像をピッタ...
-
テーブルの行を折りたたみたい...
-
テーブルの行の高さを指定する...
-
テーブルの表示がずれます
-
テーブルタグのセルの幅の一部...
-
中に<table></table>が使えるア...
-
逆L字の表(table)組み
-
ホームページ 表の上の余白を...
-
表の中の列の順番を入れ替える...
-
EXCELからhtmlへの変換で罫線が...
-
tableでcolspanを使うと次行以...
-
表の1列だけをCSSを使って右揃...
-
文字の中央そろえを一括で指定...
おすすめ情報