javascript - HTML表格字问题
问题描述
自从我使用 HTML 和 CSS 以来已经有一段时间了,但我需要一些帮助。你看,当我尝试在 HTML 中制作表格并在 CSS 中设置样式时,结果如下:
#row1 {
border: 2px;
border-spacing: 60%;
border-collapse: none;
border-color: solid black;
border-style: solid;
padding: 23px;
width: 25px;
height: 1px;
background-color: url();
}
<body>
<table>
<tr>
<div id="row1">
<td>My Account</td>
<td>Payments/Transfers<td>
</tr>
</table>
</div>
</body>
</html>
解决方案
如果您只想要第一行的边框:
table {
/* This makes borders visible, and removes spaces between cells */
border-collapse: collapse;
}
thead tr {
/* This shows a border around the table head */
border: 1px solid #000;
}
<table>
<thead>
<tr>
<th>My Account</th>
<th>Payments / Transfers</th>
</tr>
</thead>
<tbody>
<tr>
<td>356</td>
<td>$35</td>
</tr>
<tr>
<td>432</td>
<td>$23</td>
</tr>
</tbody>
</table>
推荐阅读
- python - 解决 Python 之谜
- symfony - Symfony 自动装配事件监听器
- java - 为什么我不能在 j_spring_security_check 页面上创建“链接”?
- django - 用聚合连接 DJANGO 中的两个表
- c# - 关于单元测试的问题
- reactjs - socket.io 反应 heroku 405
- python - 在Python中将具有重复键的嵌套JSON文件转换为数据框
- javascript - 加载/卸载 HTML5 时还存在 iOS Safari 内存泄漏
- swift - Swift DispatchQueue concurrentPerform OpenGL 并行渲染
- c++ - 模板函数在 VS 2015 中给出错误