html表格单元格间距在div中不起作用
我有一个非常简单的表格代码:html表格单元格间距在div中不起作用,html,css,Html,Css,我有一个非常简单的表格代码: <table cellspacing="10" cellpadding="10"> <tr> <td><div id="mini_window"></div></td> <td><div id="mini_window"></div></td>
<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,即:
#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;*/
}
它看起来像附件中的图片,这不是我想要的。我需要在每个分区之间多说20像素。出什么事了
更新:包括该页面的全部来源:
<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>
ما الجديد؟
您应该添加边距:10px
#mini_window {
top: 50%;
width:150px;
height:150px;
margin: 10px;
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;*/
}
这里的链接不起作用了…是的,现在它起作用了。是的,这正是我想要的,但我无法让它工作。我努力刷新,以确保不缓存和仍然是相同的问题。好吧,小提琴是基于你在这里发布的代码。您是否有其他可能导致冲突的代码?没有,非常确定…环境中只有一个项目…没有并行运行的代码
#mini_window {
top: 50%;
width:150px;
height:150px;
margin: 10px;
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;*/
}