html - 使用 CSS 制作响应式表格
问题描述
我有一个表格来表示 html 页面中的一些数据。我试图让这个表格通过 CSS 响应。
<table>
<tr>
<thead>
<th>Name</th>
<th>Age</th>
<th>Tell</th>
</thead>
<tbody>
<tr>
<td>Maya</td>
<td>22</td>
<td>2222555666</td>
</tr>
</tbody>
</tr>
</table>
我以前是这样做的:
table thead {display:none}
table tr, table td{display:block}
table td:nth-of-type(1)::before {content: "Name";}
有一个问题,当我知道有多少<td></td>
和内容<th></th>
是什么时,这种方式会很有帮助,但在这种情况下,我不知道的数量<td></td>
和内容<th></th>
?我能做些什么?
解决方案
推荐阅读
- java - Spring Boot MultipartFile 在 Spring Boot Embedded Tomcat 中完美运行,但在独立 Tomcat 中无法正常运行
- c# - 在 winform 上调用 SOAP Web 服务并获取 SOAP 服务中可用的方法
- python - 我想点击使用scrapy python的网站链接
- python - 稍微编辑的 tensorflow 官方示例无法正常运行
- java - Vue.js & Java-Spring/Tomcat
- apache-kafka - 幂等 Kafka Producer 写入多分区主题
- php - 使用 MySQL 将重叠的日期范围拆分为多个日期范围
- java - Java Android glide 调整图片大小
- jmeter - Jmeter线程没有独立执行
- php - 实时检测对多个设备的点击