当前位置:   article > 正文

纯CSS自适应表格_自适应表格css

自适应表格css

table {
border: 1px solid #ccc;
width: 80%;
margin:0;
padding:0;
border-collapse: collapse;
border-spacing: 0;
margin: 0 auto;
}

table tr {
border: 1px solid #ddd;
padding: 5px;
}

table th, table td {
padding: 10px;
text-align: center;
}

table th {
text-transform: uppercase;
font-size: 14px;
letter-spacing: 1px;
}

@media screen and (max-width: 600px) {

table {
  border: 0;
}

table thead {
  display: none;
}

table tr {
  margin-bottom: 10px;
  display: block;
  border-bottom: 2px solid #ddd;
}

table td {
  display: block;
  text-align: right;
  font-size: 13px;
  border-bottom: 1px dotted #ccc;
}

table td:last-child {
  border-bottom: 0;
}

table td:before {
  content: attr(data-label);
  float: left;
  text-transform: uppercase;
  font-weight: bold;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

}

</style>
  • 1
名称性别地址工作简介
11111
33333
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/812303
推荐阅读
相关标签
  

闽ICP备14008679号