我有一张数据表,需要在各种设备上显示,小到 320 像素宽的手机
我计划使用 css 媒体查询来检测浏览器窗口大小,并在响应版本通过 { display: block; 低于某个级别时显示响应版本。} 并隐藏标准版本。
响应式版本只会将列堆叠在一起。
我的问题是,我应该为响应式版本使用哪些 html 标签。目前我只是使用一堆功能但似乎不正确的 div。或者也许是?
<div class="standard_version">
<table>
<tr>
<th>Column A</th>
<th>Column B</th>
<th>Column C</th>
<th>Column D</th>
</tr>
<tr>
<td>4rq4</td>
<td>vdg34</td>
<td>xcb245</td>
<td>12341234</td>
</tr>
<tr>
<td>sdvxc4</td>
<td>898fg</td>
<td>sfasdf35</td>
<td>451345</td>
</tr>
<tr>
<td>asdfasf</td>
<td>zxdfw</td>
<td>1A2313</td>
<td>9732</td>
</tr>
</table>
</div>
<div class="responsive_version">
<div class="responsive_version_tr">
<div class="responsive_version_th">Column A</div>
<div class="responsive_version_th">Column B</div>
<div class="responsive_version_th">Column C</div>
<div class="responsive_version_th">Column D</div>
</div>
<div class="responsive_version_tr">
<div class="responsive_version_td">4rq4</div>
<div class="responsive_version_td">vdg34</div>
<div class="responsive_version_td">xcb245</div>
<div class="responsive_version_td">12341234</div>
</div>
<div class="responsive_version_tr">
<div class="responsive_version_td">sdvxc4</div>
<div class="responsive_version_td">898fg</div>
<div class="responsive_version_td">sfasdf35</div>
<div class="responsive_version_td">451345</div>
</div>
<div class="responsive_version_tr">
<div class="responsive_version_td">asdfasf</div>
<div class="responsive_version_td">zxdfw B</div>
<div class="responsive_version_td">1A2313</div>
<div class="responsive_version_td">9732</div>
</div>
</div>
提前致谢!