Html 我如何在每个桌子框周围加上边框?
当我在表格中的每个框周围放置表格边框时,我遇到了麻烦,它只是显示没有边框的表格 我希望它显示带有边框的表格 我曾尝试在w3schools中使用Html 我如何在每个桌子框周围加上边框?,html,css,Html,Css,当我在表格中的每个框周围放置表格边框时,我遇到了麻烦,它只是显示没有边框的表格 我希望它显示带有边框的表格 我曾尝试在w3schools中使用css作为表格边框,但似乎不起作用,我还添加了一个!它的重要标签,但它似乎仍然不起作用 html: <!DOCTYPE html> <?php $database = "seriousdiseases"; $database = new mysqli('localhost
css
作为表格边框,但似乎不起作用,我还添加了一个!它的重要标签,但它似乎仍然不起作用
html:
<!DOCTYPE html>
<?php
$database = "seriousdiseases";
$database = new mysqli('localhost', 'root', '', $database) or die ("Unable to connect to the
DB");
?>
<html>
<head>
<title>Ribose-5-phosphate isomerase deficiency</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div id="container2">
<div id="header">
<h1>Ribose-5-phosphate isomerase deficiency</h1>
</div>
<div id="content">
<div id="nav">
<h3>Navigation</h3>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="aboutUs.html">About Me</a></li>
<li><a href="video.html">Video</a></li>
<li><a href="seriousDiseases.html">Serious Diseases</a></li>
<li><a href="updateDiseases.php">Update Diseases</a></li>
<img src="F1large.jpg" alt="Navigation Picture." style="height:500px;">
</ul>
</div>
<div id="main">
<table>
<tr>
<th>Id</th>
<th>Disease</th>
<th>Symptoms</th>
</tr>
<?php
$result = mysqli_query($database, "select * from feature") or die
("Unable to connect to the DB");
while ($row = mysqli_fetch_array($result)){
print("<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>"
. $row[2] . "</td></tr>");
}
$database->close();
?>
</table>
</div>
</div>
</div>
<div id="footer">
Copyright © 2020 CLINIC SCOPE
</div>
</body>
</html>
html, body {
height: 100%;
}
body {
background-color: #EEE;
font-family: Helvetica, Arial, sans-serif;
background-image: url (logo.png);
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
display: flex;
flex-direction: column;
}
table, th, td{
border: 1px solid black !important;
}
h1, h2, h3 {
margin: 0;
}
a {
text-decoration: none;
color: blue;
}
#container {
background-color: white;
margin-left: 0px;
margin-right: 0px;
position: relative;
min-height: 97.7vh;
}
#container2 {
background-color: white;
margin-left: 0px;
margin-right: 0px;
position: relative;
}
#header {
background-color: blue;
color: white;
text-align: center;
padding: 10px;
}
#content {
padding:10px;
margin-right:0px;
}
#nav ul {
list-style-type: none;
}
#nav .selected {
font-family: bold;
}
#nav {
width: 18%;
float: left;
}
#main {
width: 60%;
float: right;
}
#footer {
color: white;
background-color: black;
width: 100%;
text-align: center;
position: relative;
bottom: 0;
}
尝试在您的表标记中添加此属性
什么是jsfiddle,jqueryHtmlCSS?jsfiddle.net是一个好地方,在这里发布问题之前可以使用。它类似于可运行的堆栈片段。阅读所有关于如何使您的代码以其他方式运行的内容,此处已使用css表添加了table border属性,th,td{border:1px纯黑!重要;}我认为问题在于css未应用于此html,可能css文件未链接查看此处的可运行堆栈片段以了解更多信息