html - 我如何制作这种桌子?我试过这样做,但总是出现一条额外的线
解决方案
希望下面的回答对你有帮助
要合并表格单元格,您必须跨跨度或行跨度,更多详细信息请查看此链接单击此处
选项1
要创建此表,
- 我已经通过 html 默认高度和宽度属性设置了宽度和高度
- 我使用以下css代码处理表格边框,必须使用。(了解更多点击此链接:链接)
table, th, td {
border:1px solid black;
border-collapse: collapse;
}
<table width="100%">
<thead>
<tr>
<th height="40px" colspan="2"></th>
<th height="40px"></th>
</tr>
</thead>
<tbody>
<tr>
<td height="40px"></td>
<td height="40px"></td>
<td height="40px" rowspan="2"></td>
</tr>
<tr>
<td height="250px"></td>
<td height="250px"></td>
</tr>
</tbody>
</table>
选项 2
要创建此表,
- 我已经通过内联 css 设置了宽度和高度
- 无需加载外部 CSS 代码,所有样式均通过内联 css 完成
- 边框是通过默认的 html 属性border="1" 设置的
<table border="1" style="width: 100%; border-collapse: collapse;">
<thead>
<tr>
<th style="height: 40px;" colspan="2"></th>
<th style="height: 40px;"></th>
</tr>
</thead>
<tbody>
<tr>
<td style="height: 40px;"></td>
<td style="height: 40px;"></td>
<td style="height: 40px;" rowspan="2"></td>
</tr>
<tr>
<td style="height: 250px;"></td>
<td style="height: 250px;"></td>
</tr>
</tbody>
</table>
推荐阅读
- php - 1064 Doctrine 中的 SQL 语法有错误。为什么?
- mysql - 尝试使用 mysql 检索其中具有命名空间的 xml 标记值。下面是示例 xml 代码,要提取 dateTo 字段的值
- ack - 当我在单个文件中搜索时,确认不显示行号
- java - 我看不到数据,也看不到我的表创建了 sqlite
- linux - Docker-Compose:服务 xxx 依赖于未定义的服务 xxx
- reactjs - 如何在 React js 中更新动态生成的表单
- java - 在 android 应用程序中使用 .exe 文件
- php - wkhtmltopdf 在每个页面的内容之间添加空格
- iis - HTTP 错误 500.19 - 内部服务器错误错误代码 0x80070021
- java - 我在我的 Java 程序中得到 NullPointerExecption