我包含了css以使表具有响应性,但这使得具有datepicker的td可以在单行中显示每月的日期
table {
border-collapse: collapse;
margin: 0;
padding: 0;
width: 100%;
}
table caption {
font-size: 1.5em;
margin: .5em 0 .75em;
}
table tr {
padding: .35em;
}
table th,table td {
padding: 625em;
ext-align: center;
}
table th {
font-size: .85em;
letter-spacing: .1em;
text-transform: uppercase;
}
@media screen and (max-width: 600px) {
table {
border: 0;
}
table caption {
font-ize: 1.3em;
}
table thead {
border: none;
clip: rect(0 0 0 0);
height: 1px;
margin: 1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
table tr {
display: block;
margin-bottom: .625em;
}
table td {
display: block;
font-size: .8em;
text-align: right;
}
table td::before {
content: attr(data-label);
float: left;
font-weight: bold;
text-transform: uppercase;
}
table td:last-child {
border-bottom: 0;
}
}


发布于 2020-01-04 15:00:43
您需要更具体一点,而不是更改html中的每个table元素。给你想要响应的表一个class,即myresponsivetable
<table class="myresponsivetable"> ... </table>
然后相应地调整你的CSS:
table.myresponsivetable {
border-collapse: collapse;
margin: 0;
padding: 0;
width: 100%;
}
table.myresponsivetable caption {
font-size: 1.5em;
margin: .5em 0 .75em;
}
table.myresponsivetable tr {
padding: .35em;
}
table.myresponsivetable th,table.myresponsivetable td {
padding: 625em;
ext-align: center;
}
table.myresponsivetable th {
font-size: .85em;
letter-spacing: .1em;
text-transform: uppercase;
}
@media screen and (max-width: 600px) {
table.myresponsivetable {
border: 0;
}
table.myresponsivetable caption {
font-ize: 1.3em;
}
table.myresponsivetable thead {
... and so on ...然后,此CSS将不会应用于日期选择器
https://stackoverflow.com/questions/59587738
复制相似问题