[CSS3] Responsive Table -- no more table
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的更多相关文章
- OpenFlow Switch学习笔记(五)——Group Table、Meter Table及Counters
本文主要详述OpenFlow Switch的另外两个主要组件——Group Table和Meter Table,它们在整个OpenFlow Swtich Processing中也起到了重要作用. 1. ...
- delete table 和 truncate table
delete table 和 truncate table 使用delete语句删除数据的一般语法格式: delete [from] {table_name.view_name} [where< ...
- MySQL删除大表时潜在的问题(drop table,truncate table)
来源于:https://www.cnblogs.com/CtripDBA/p/11465315.html,侵删,纯截图,避免吸引流量之嫌 case1,删除大表时,因为清理自适应hash索引占用的内容导 ...
- 【翻译】Flink Table Api & SQL —— Table API
本文翻译自官网:Table API https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/tableApi.ht ...
- 【table】给table表格设置一个通用的css3样式(默认有斑马条纹)
/* = 表格(默认有斑马条纹) ------------------------------------------ */ .data-table { margin: 10px 0; } .data ...
- 【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 ,.. ...
- 【MySQL】 empty table and delete table.
1.MySQL生成删除满足条件的表的sql: 1 SELECT 2 CONCAT( 3 'DROP TABLE ', 4 GROUP_CONCAT(table_name), 5 ';' 6 ) AS ...
- 页面动态table动态合并table
function hebingRows(col, atrrb) { var trs = $("table tbody tr"); var rows = 1; for (var i ...
- truncate table和delete table 的区别
truncate table和不带 where 的 detele 功能一样,都是删除表中的所有数据. 但TRUNCATE TABLE 速度更快,占用的日志更少,这是因为 TRUNCATE TABLE ...
随机推荐
- spring datasource和mybatis的datasource来源在哪里
配置一个数据源 spring在第三方依赖包中包含了两个数据源的实现类包,其一是Apache的DBCP,其二是 C3P0.可以在Spring配置文件中利用这两者中任何一个配置数据源. 配置一个 ...
- Cocos2d-x碰撞检測
假设不适用Box2D物理引擎.那么要进行Cocos2d-x的碰撞检測那我们的方法往往就是进行"矩形和点"."矩形和矩形"这样粗略的碰撞检測.我们一般採取开启sc ...
- Yarn架构基本概况(二)
在概况(一)中,主要简单的对Yarn的情况作了简单的介绍,今天花一定时间在某些详细的模块上呈现下面Yarn的总体情况.帮助大家更好的理解Yarn. 1)ResourceManager 在Yarn的总体 ...
- Mysql第四天 数据库设计
不考虑主备.集群等方案,基于业务上的设计主要是表结构及表间关系的设计. 而关于表中字段主要是依据业务来进行定义,我们能够指定的大概有这么几项: 存储引擎 一般用InnoDB,特殊需求特殊选用 字符集和 ...
- 验证DG最大性能模式下使用ARCH/LGWR及STANDBY LOG的不同情况
总结: --两台单实例数据库做DG,数据库版本号10.2.0.1.0 1.主库配置为:arch async,备库无STANDBY LOG. 日志中会有:RFS[4]: No standby redo ...
- 如何在IE浏览器里模仿DomContentLoaded
稍微了解一点框架的事件绑定的都知道 window.onload 事件需要在页面所有内容(包括图片.flash.iframe等)加载完后,才执行,但往往我们更希望在 DOM 一加载完就执行脚本,而各大框 ...
- audio_coding模块分析和audio_conference_mixer模块分析
audio_coding 1. 主要接口 AudioCodingModuleImpl::RegisterReceiveCodec 初始化Codec AudioCodingModul ...
- log4j日志存储到数据库
一.前提条件 系统必须是使用LOG4J进行日志管理,否则方法无效. 系统必须包含commons-logging-xxx.jar,log4j-xxx.jar这两个JAR包,XXX为版本号. 二.操作步骤 ...
- linux HBA 卡驱动安装
系统环境操作系统 : RHEL5.0设备 DL580G5 HBA 卡:Qlogic 2343连接存储: EVA8100---------------------------------------- ...
- React组件化开发
环境搭建: 1.安装node.js 2.安装cnpm # npm install -g cnpm --registry=https://registry.npm.taobao.org 3.全局安装c ...