你好,我正在写一些html代码,其中我有太多的表格进行对比。在一个表格中,我已经使border-collapse属性作为单独的,而在另一个我已经使它折叠。问题是在另一个表,因为我覆盖它折叠边界,由于某种原因,我不能改变边界的颜色使用颜色属性。这里是一些代码的审查
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Living vs Non living</title>
<style type="text/css">
body{background-color:RGB(255,251,214)}
table,th,td{border:1px solid red}
table{border-collapse:separate;border-spacing:20px}
</style>
</head>
<body>
<table>
<caption><h3>Livings things and non-living things</h3></caption>
<tr>
<th style = background-color:red;color:white>Living things</th>
<th style = background-color:red;color:white>Non Living things</th>
</tr>
<tr>
<td>Consists of cell</td>
<td>No cell</td>
</tr>
<tr>
<td>Needs food for energy</td>
<td>Needs no food</td>
</tr>
<tr>
<td>Shows growth and movement</td>
<td>No growth and movement</td>
</tr>
</table>
<table style="border-width:1px;border-style:solid;border-color:blue;color:white">
<caption><h3>Livings things and non-living things</h3></caption>
<tr>
<th style = background-color:cyan>Living things</th>
<th style = background-color:cyan>Non Living things</th>
</tr>
<tr>
<td>Consists of cell</td>
<td>No cell</td>
</tr>
<tr>
<td>Needs food for energy</td>
<td>Needs no food</td>
</tr>
<tr>
<td>Shows growth and movement</td>
<td>No growth and movement</td>
</tr>
</table>
</body>
</html>
感谢您抽出时间阅读我的问题
1条答案
按热度按时间6rqinv9w1#
结果,我所需要做的就是分别编辑td和th以及在标题中完成的工作。我认为这样做是为了更容易地编辑表中的任何元素