使用表格布局的响应表

时间:2015-06-18 19:43:16

标签: html css responsive css-tables

我一直试图弄清楚为什么我的桌子在600px时无法在我的屏幕上正确显示。我在codepen上尝试过它的工作正常,必须有一些东西阻止它在小屏幕上正确呈现。

Demo

@media screen and (max-width:600px){
    .sample{
        background:blue;
    }

    table {
      border: 0;

    }

    table thead {
      display: none;
    }

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

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

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

    table td:before {
      content: attr(data-label);
      float: left;
      text-transform: uppercase;
      font-weight: bold;
    }
}

这是我在网络浏览器上以600px的速度获得的。

enter image description here

0 个答案:

没有答案