我想为特定的表类文件设置下面提到的响应表代码。怎么做。我使用CSSTableGenerator作为表类。如果我使用此代码,普通表也会产生影响。但我想只为CSSTableGenerator类文件设置它。请指导我
/*
Max width before this PARTICULAR table gets nasty
This query will take effect for any screen smaller than 760px
and also iPads specifically.
*/
@media
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px) {
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
tr { border: 1px solid #ccc; }
td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 50%;
}
td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
}
}
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
body {
padding: 0;
margin: 0;
width: 320px; }
}
/* iPads (portrait and landscape) ----------- */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
body {
//width: 495px;
}
}
答案 0 :(得分:1)
/ * 此特殊表之前的最大宽度变得令人讨厌 此查询将对小于760px的任何屏幕生效 还有iPad专门。 * / @媒体 只有屏幕和(最大宽度:760px), (min-device-width:768px)和(max-device-width:1024px){
transparent
我希望这应该有所帮助,添加您用于表的确切类名。在您的情况下,您将属性添加到常规标记,因此它将影响每个表。