私は非常に単純なテーブルの次のコードを持っています:
<table cellspacing="10" cellpadding="10">
<tr>
<td><div id="mini_window"></div></td>
<td><div id="mini_window"></div></td>
<td><div id="mini_window"></div></td>
</tr>
</table>
このテーブルコードはこのdiv内にあります。
#body_content {
top: 30%;
left: 36%;
width:70%;
height:18em;
margin-top: -9em; /*set to a negative number 1/2 of your height*/
margin-left: -15em; /*set to a negative number 1/2 of your width*/
border-bottom: 1px solid #ccc;
border-top: 1px solid #ccc;
/*background-color: #f3f3f3;*/
position:fixed;
direction: rtl;
}
テーブルセル内には、次のようなmini_windowdivがあります。
#mini_window {
top: 50%;
width:150px;
height:150px;
margin-top: 20px; /*set to a negative number 1/2 of your height*/
/*border-bottom: 1px solid #ccc;*/
/*border-top: 1px solid #ccc;*/
border: 1px solid black;
background-color: #f3f3f3;
/*direction: rtl;*/
}
添付の写真のように見えますが、それは私が望んでいたことではありません。私は各divの間に多かれ少なかれ20pxと言う必要があります。何が問題になっていますか?
更新:そのページのソース全体を含めます:
<html>
<head>
<?php include_once('required_css.php'); ?>
<?php include_once('required_js.php'); ?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php include_once('header.php'); ?>
<div id="body_content">
<h1>ما الجديد؟</h1>
<table cellspacing="10" cellpadding="10">
<tr>
<td><div id="mini_window"></div></td>
<td></td>
<td><div id="mini_window"></div></td>
<td></td>
<td><div id="mini_window"></div></td>
</tr>
</table>
</div>
</body>
</html>