如何让此网站表格包含边框?

时间:2015-01-09 19:00:23

标签: html css html-table border outline

我正在为一个网站编程工作(几乎没有编码经验,所以我可能会遗漏关键信息 - 将根据需要更新)。 DOCTYPE html Public,link href ="包括/ style.css"的rel ="样式表"类型="文本/ CSS"媒体="所有"

<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网页时,表格不包含边框,因此很难区分文本行。有没有人有可能的解决方案?

1 个答案:

答案 0 :(得分:0)

你的.html文件应该设置如下,

<...DOCTYPE etc...>
<html>
<head>
</head>
<body>
<div id="main">
<table>
Table contents...
</table>
</div>
</body>
</html>

这是因为您的代码应该包含几乎所有文档。和标签都应该由标签包含。然后在你的标签内应该是你的css文件,外部字体等的所有外部链接。

标签内部应该是所有其他标签,以及所有其他标签。

我希望这会有所帮助。我可能没有理解你的所有观点,但它看起来是你的html文档的安排是问题。 :)