我正在为工作网站编程(几乎没有编码经验,所以我可能会遗漏重要信息 - 将根据需要进行更新)。 DOCTYPE html 公共(public)链接 href="includes/style.css"rel="stylesheet"type="text/css"media="all"
<div id="main">
<table border="1" style="width:100%">
<...>
</table>
</body>
</html>
</div><!--#main -->
我在 .html 文档中使用以下格式设置了一个名称表:
<div id="main">
<table border="1" style="width:100%">
<...>
</table>
</body>
</html>
</div><!--#main -->
现在,在style.css中,表格定义如下
table.hist-table {
width:98%;
border: 1px solid #CCC;
font-size:12px;
border-spacing:0px;
}
.hist-table tr{
border:1px solid #CCC;
}
.hist-table .row1 td {
padding: 4px;
margin: 3px;
border: 0px solid #ccc;
vertical-align: text-top;
background-color: #eff0f1;
}
.his-table th {
padding:4px;
text-align: left;
background-color: #00274c;
color: #FFF;
font-weight: bold;
}
#header {
margin-top: 30px;
clear:both;
background: #536a93;
background: #00274c;
padding: 0px 0 10px 60px;
margin: 0 4.6%
font-size: 11px;
max-width: 1000px;
}
由于某些原因,当打开 .html 网页时,表格不包含边框,因此很难区分文本行。有没有人有可能的解决方案?
最佳答案
你的.html文件应该设置如下,
<...DOCTYPE etc...>
<html>
<head>
</head>
<body>
<div id="main">
<table>
Table contents...
</table>
</div>
</body>
</html>
这是因为您的标签应该包含几乎所有文档。和标签都应该包含在标签中。然后在你的标签中应该是你的所有外部链接到你的 css 文件、外部字体等。
您的标签内部应该是所有 、 和所有其他标签。
希望对您有所帮助。我可能没有理解您的所有观点,但看起来问题出在您的 html 文档的排列上。 :)
关于html - 如何让这个网站表格包含边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27867375/