【发布时间】:2019-02-16 16:15:59
【问题描述】:
我正在尝试使此表响应重新调整浏览器的大小,特别是移动设备。我试图将表格标签的宽度设置为 100%,但这会影响我的图像和文本的间距。有没有其他方法可以让这个表格响应它不影响我的图像和文本间距的地方?非常感谢您提前回复。
<table align="center" border="0" cellpadding="3" cellspacing="1" style="width: 1000px;">
<tbody>
<tr>
<td style="text-align: center; vertical-align: middle;">
<img alt="Logo" src="Logo.png" style="width: 120px; height: 100px;" />
</td>
<td style="vertical-align: middle; text-align: center;">
<b><i>
Everyone is free to use the summary information. Please acknowledge
the Logo as the source of any information accessed from the site unless
otherwise noted.<br/>
</i></b>
</td>
<td style="text-align: center; vertical-align: middle;">
<img alt="Logo" src="Logo.png" style="width: 120px; height: 100px;" />
</td>
</tr>
</tbody>
</table>
【问题讨论】:
-
您可以通过将整个表格包装在中来尝试引导类“table-responsive”
-
太好了,非常感谢。成功了!
-
如果您不想要 bootstrap 提供的水平滚动功能,您还可以使用媒体查询为每个选定的断点手动调整表格列的宽度。至于图像,您可以使用引导程序的“img-responsive”类,只需将其放在
标记中即可。
标签: html html-table responsive