Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML页边距不是';行不通_Html_Css_Margin - Fatal编程技术网

HTML页边距不是';行不通

HTML页边距不是';行不通,html,css,margin,Html,Css,Margin,我正试着给我的桌子加些边距。填充和边框起作用,但边距不起作用 th{ 边框:1px纯黑; 利润率:10px; 填充:10px; } 与单元格间距类似,在css中,您可以使用边框间距以及边框折叠:分离属性,应用于父表标记 表格{ 边界间距:10px; 边界塌陷:分离; } th{ 边框:1px纯黑; 利润率:10px; 填充:10px; } 尝试定义每个页边距边: margin-top: 10px; margin-bottom: 10px; margin-right: 10px; margin

我正试着给我的桌子加些边距。填充和边框起作用,但边距不起作用

th{
边框:1px纯黑;
利润率:10px;
填充:10px;
}

与单元格间距类似,在css中,您可以使用
边框间距
以及
边框折叠:分离
属性,应用于父
标记

表格{
边界间距:10px;
边界塌陷:分离;
}
th{
边框:1px纯黑;
利润率:10px;
填充:10px;
}

尝试定义每个页边距边:

margin-top: 10px;
margin-bottom: 10px;
margin-right: 10px;
margin-left: 10px;
您必须定义边距的每一侧。 如果您需要有关页边距的更多帮助,请参阅此链接:

如果要添加边距,需要添加表格cellspacing=“10” 这是我要测试的代码,请尝试此代码

  <html>
<head>

<style>
     th {
      border: 1px solid black;        
      padding: 10px;
    }
</style>
</head>
<body>
<table id="Expon" cellspacing="10">
  <tr>
    <th>gfhd</th>
    <th>dfgh</th>
    <th>gfh</th>
  </tr>
  <tr>
    <th>gfh</th>
    <th>fgh</th>
    <th>gfh</th>
  </tr>
  <tr>
    <th>fgdh</th>
    <th>gfh</th>
    <th>fgh</th>
  </tr>
</table>
</body>
</html>

th{
边框:1px纯黑;
填充:10px;
}
绿色房屋署
dfgh
gfh
gfh
fgh
gfh
fgdh
gfh
fgh
用于在单元格之间留出空间,而不是使用边距

th{
边框:1px纯黑;
填充:10px;
}
桌子{
边界间距:10px;
}


可能相关:考虑添加上面的代码示例的JSFIDLE链接,因此其他人更容易尝试解决您的问题。TH/TDS不能有余量。没有DOCTYPE声明设置了真正的不好的例子。@ Bhansa,您不需要再评论,直到您学到更多的东西。