When the screen size is small, we can use "no more table" solution. So instead of render table is row layout, we render it in column layout.

Given the table below:

 <table>
<thead>
<tr>
<th>Team</th>
<th>1st</th>
<th>2nd</th>
<th>3rd</th>
<th>4th</th>
<th>5th</th>
<th>6th</th>
<th>7th</th>
<th>8th</th>
<th>9th</th>
<th>Final</th>
</tr>
</thead>
<tbody>
<tr>
<td data-th="Team">Toronto</td>
<td data-th="1st">0</td>
<td data-th="2nd">0</td>
<td data-th="3rd">0</td>
<td data-th="4th">4</td>
<td data-th="5th">0</td>
<td data-th="6th">1</td>
<td data-th="7th">0</td>
<td data-th="8th">0</td>
<td data-th="9th">0</td>
<td data-th="Final">5</td>
</tr>
<tr>
<td data-th="Team">San Francisco</td>
<td data-th="1st">0</td>
<td data-th="2nd">0</td>
<td data-th="3rd">0</td>
<td data-th="4th">4</td>
<td data-th="5th">0</td>
<td data-th="6th">0</td>
<td data-th="7th">0</td>
<td data-th="8th">0</td>
<td data-th="9th">0</td>
<td data-th="Final">4</td>
</tr>
</tbody>

1. Reset table relatede element to block element:

table, thead, tbody, th, td, tr {
display: block;
}

2. Remove the thead:

        thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}

3. Position layout:

       /*The actually content will be on the right side*/
td {
position: relative;
padding-left: 50%;
} /*Using data-th to set the value and set position to left*/
td:before {
position: absolute;
left: 6px;
content: attr(data-th);
font-weight: bold;
}

Full example:

[CSS3] Responsive Table -- no more table的更多相关文章

  1. OpenFlow Switch学习笔记(五)——Group Table、Meter Table及Counters

    本文主要详述OpenFlow Switch的另外两个主要组件——Group Table和Meter Table,它们在整个OpenFlow Swtich Processing中也起到了重要作用. 1. ...

  2. delete table 和 truncate table

    delete table 和 truncate table 使用delete语句删除数据的一般语法格式: delete [from] {table_name.view_name} [where< ...

  3. MySQL删除大表时潜在的问题(drop table,truncate table)

    来源于:https://www.cnblogs.com/CtripDBA/p/11465315.html,侵删,纯截图,避免吸引流量之嫌 case1,删除大表时,因为清理自适应hash索引占用的内容导 ...

  4. 【翻译】Flink Table Api & SQL —— Table API

    本文翻译自官网:Table API  https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/tableApi.ht ...

  5. 【table】给table表格设置一个通用的css3样式(默认有斑马条纹)

    /* = 表格(默认有斑马条纹) ------------------------------------------ */ .data-table { margin: 10px 0; } .data ...

  6. 【SqlServer】empty table and delete table and create table

    1.建表 1 IF object_id (N'表名', N'U') IS NULL CREATE TABLE 表名 ( 2 id INT IDENTITY (1, 1) PRIMARY KEY ,.. ...

  7. 【MySQL】 empty table and delete table.

    1.MySQL生成删除满足条件的表的sql: 1 SELECT 2 CONCAT( 3 'DROP TABLE ', 4 GROUP_CONCAT(table_name), 5 ';' 6 ) AS ...

  8. 页面动态table动态合并table

    function hebingRows(col, atrrb) { var trs = $("table tbody tr"); var rows = 1; for (var i ...

  9. truncate table和delete table 的区别

    truncate table和不带 where 的 detele 功能一样,都是删除表中的所有数据. 但TRUNCATE TABLE 速度更快,占用的日志更少,这是因为 TRUNCATE TABLE ...

随机推荐

  1. apple Swift语言新手教程

    Apple Swift编程语言新手教程 文件夹 1   简单介绍 2   Swift入门 3   简单值 4   控制流 5   函数与闭包 6   对象与类 7   枚举与结构 1   ...

  2. Oracle数据的基本操作

    一.什么是Oracle 在学习DRP系统之前,非常多次提到过Oracle,也了解过,那么Oracle是什么?今天我最终揭开了它的神奇面纱. Oracle:是一个公司.当然我在这里说的是Oracle数据 ...

  3. Ubuntu14.04编译WebRTC For Android代码 2014-07-24

    整整快一年没有写博客了.近期基于Google开源的WebRTC项目做了一款音视频聊天的即时通信项目,期间在下载WebRTC代码时就碰到了一些问题.在此以作记录,也希望可以帮助到正在下载编译WebRTC ...

  4. ftk学习记(首篇)

    [ 声明:版权全部,欢迎转载,请勿用于商业用途.  联系信箱:feixiaoxing @163.com] 非常早之前就知道ftk了,当时主要是由于买了李先静的书,所以知道了这么一个项目.由于对这样的g ...

  5. c3---scanf

    #include <stdio.h> int main(int argc, const char * argv[]) { // 要求: 存储用户输入的整数 // 1.用户输入的整数确定吗? ...

  6. uninstall OpenJDK9

    sudo apt--jre openjdk--jdk ///要慎用auto命令,会把所有的软件包删掉 https://www.linuxidc.com/Linux/2017-11/148941.htm ...

  7. Oracle 优化和性能调整

    分析评价Oracle数据库性能主要有数据库吞吐量.数据库用户响应时间两项指标.数据库用户响应时间又可以分为系统服务时间和用户等待时间两项,即:  数据库用户响应时间=系统服务时间+用户等待时间  因此 ...

  8. centos + nodejs + egg2.x 开发微信分享功能

    本文章发到掘金上,请移步阅读: https://juejin.im/post/5cf10b02e51d45778f076ccd

  9. 如何让MP4 video视频背景色变成透明?

    本文转自:https://www.zhangxinxu.com/wordpress/2019/05/mp4-video-background-transparent/ 亲测,pc端有效,但移动端微信内 ...

  10. 客户现场调试(连接oracle数据库)

    1.System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本 http://blog.csdn.net/yucaoye/article/details/ ...