【发布时间】:2019-05-05 13:38:30
【问题描述】:
此代码用于溢出divs 内的所有表格(在移动设备上响应)。需要注意的是,所有divs 都必须位于名为“maintable”的表中。
@media only screen and (max-width: 800px) {
table.maintable td>div {
padding-left: 0px !important;
padding-right: 0px !important;
width: 100%;
overflow-x: scroll;
overflow-y: hidden;
}
.maintable, .maintable tbody, .maintable tbody tr, .maintable tbody tr td
{
display: block;
overflow: hidden;
width: 100%;
overflow-x: scroll;
}
#responsive-tables table {
overflow-x: scroll;
overflow-y: hidden;
width: 100%;
}
#responsive-tables tbody tr {
display: table-row;
}
#responsive-tables tbody tr td {
display: table-cell;
padding: 15px 10px;
vertical-align: inherit;
width: -webkit-fill-available;
}
#responsive_mobile_outer img {
width: 100%;
margin: 0 auto;
text-align: center;
display: block;
max-width: 300px;
}
}
对于这个页面:
<table class="maintable" cellpadding="0" cellspacing="0">
<tr>
<td>
<div id="responsive-tables"><table class="feestable" align="center" border="0" cellpadding="2" cellspacing="1" width="99%">
....
</table></div>
如何摆脱“maintable”并使其适用于该页面?
<div class="best">
<div class="maincell">
<div id="responsive-tables"><table class="feestable" align="center" border="0" cellpadding="2" cellspacing="1" width="99%">
....
</table></div>
【问题讨论】:
-
“如何摆脱“maintable”是什么意思?
-
我不想要 maintable。相反,我想要
标签: html css html-table responsive-design