【问题标题】:How do I get this website table to include a border?如何让这个网站表格包含边框?
【发布时间】:2015-03-08 04:13:40
【问题描述】:

我正在编写一个工作网站(几乎没有编码经验,所以我可能会遗漏重要信息 - 将根据需要进行更新)。 DOCTYPE html 公共,链接 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 css html-table border outline


【解决方案1】:

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

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

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

您的标签内部应该是所有的 , 和所有其他标签。

我希望这会有所帮助。我可能没有理解您的所有观点,但看起来问题在于您的 html 文档的排列。 :)

【讨论】:

    猜你喜欢
    • 2012-08-07
    • 2013-02-20
    • 2020-12-01
    • 2022-11-21
    • 2015-10-09
    • 2011-11-18
    • 2016-09-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多