【发布时间】:2017-06-23 22:59:27
【问题描述】:
当我在小屏幕 320x568 中运行此代码时,表格内容会溢出包含它的整个 div。有什么办法可以解决这个问题。我希望他压缩或收缩一点只是为了适合容器。谢谢
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row ">
<table class="table table-bordered table-sm table-responsive">
<tbody>
<tr>
<td style="padding:20px">
<p><strong>PART A - Reading Material </strong></p>
<ul style="list-style-type:roman">
<li><span class="blueprint">Self-help books</span></li>
<li><span class="blueprint">Annotation sources</span></li>
<li>Academic references
<ul>
<li><span class="blueprint">printed</span></li>
<li><span class="blueprint">online</span></li>
</ul>
</li>
<li><span class="blueprint">Editions of Batman</span></li>
</ul>
</td>
<td style="padding:20px">
<p><strong>Part B – Audio & Visual Material</strong></p>
<ul start="5" style="list-style-type:roman; ">
<li><span class="blueprint">Lectures on DVD</span></li>
<li><span class="blueprint">YouTube original content</span></li>
<li><span class="blueprint">Films & TV productions</span></li>
<li><span class="blueprint">Audio recordings</span></li>
</ul>
<br>
<br>
</td>
<td style="padding:20px">
<p><strong>PART C – Material by Level</strong></p>
<ul start="9" style="list-style-type:roman; ">
<li><span class="blueprint">Introduction</span></li>
<li><span class="blueprint">Variety of Materials</span></li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
【问题讨论】:
-
css基于这个div,table在哪里??
-
表格不应该真正用于内容,因为它对 SEO 不利。它们应该只用于数据集。表格也不是很敏感。我建议使用网格并将它们堆叠在移动设备上。
-
唯一的其他解决方案是减少
tds 上的填充并大大减小小屏幕的字体大小,但这会使内容难以阅读。
标签: jquery html css twitter-bootstrap