amazeui学习笔记--css(HTML元素5)--表格Table
amazeui学习笔记--css(HTML元素5)--表格Table
一、总结
1、基本样式:am-table;直接模块名 <table class="am-table">
2、表格边框: 添加 .am-table-bordered 类。 <table class="am-table am-table-bordered">
3、圆角边框: 同时添加 .am-table-bordered 、 .am-table-radius,外层圆角边框通过 box-shadow 实现。 <table class="am-table am-table-bordered am-table-radius am-table-striped">
4、单元格状态(颜色):就是那些基本颜色
.am-active激活;.am-disabled禁用;.am-primary蓝色高亮;.am-success绿色高亮;.am-warning橙色高亮;.am-danger红色高亮。
5、斑马纹效果及hover效果: <table class="am-table am-table-striped am-table-hover">
.am-table-striped斑马纹效果.am-table-hoverhover 状态
6、紧凑型表格:添加 .am-table-compact class,调整 padding 显示更紧凑的单元格。 <table class="am-table am-table-bordered am-table-striped am-table-compact">
7、响应式表格:
.am-text-nowrap: 禁止文字换行;.am-scrollable-horizontal: 内容超出容器宽度时显示水平滚动条。
<div class="am-scrollable-horizontal">
<table class="am-table am-table-bordered am-table-striped am-text-nowrap">
...
</table>
</div>
8、单元格对齐:
<table>上添加.am-table-centered实现单元格居中对齐- 单元格上添加
.am-text-middle可以实现垂直居中,同样,在单元格上添加其他文本对齐 class 可以实现想要的效果(参见辅助类)
二、表格Table
使用时注意 <table> HTML 结构的完整性。
表格相关 JS 插件:
基本样式
添加 .am-table。
| 网站名称 | 网址 | 创建时间 |
|---|---|---|
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI(Active) | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
<table class="am-table">
<thead>
<tr>
<th>网站名称</th>
<th>网址</th>
<th>创建时间</th>
</tr>
</thead>
<tbody>
<tr>
<td>Amaze UI</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
<tr>
<td>Amaze UI</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
<tr class="am-active">
<td>Amaze UI(Active)</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
<tr>
<td>Amaze UI</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
<tr>
<td>Amaze UI</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
</tbody>
</table>
基本边框
添加 .am-table-bordered 类。
| 网站名称 | 网址 | 创建时间 |
|---|---|---|
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
<table class="am-table am-table-bordered">
...
</table>
圆角边框
同时添加 .am-table-bordered 、 .am-table-radius,外层圆角边框通过 box-shadow 实现。
| 网站名称 | 网址 | 创建时间 |
|---|---|---|
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
<table class="am-table am-table-bordered am-table-radius am-table-striped">
...
</table>
单元格状态
表示表格状态的 class 添加到 tr 整行整行,添加到 td 高亮单元格。
.am-active激活;.am-disabled禁用;.am-primary蓝色高亮;.am-success绿色高亮;.am-warning橙色高亮;.am-danger红色高亮。
| Class | 状态描述 | 目标元素 |
|---|---|---|
| .am-active | 激活 | td |
| .am-active | 激活 | tr |
| .am-disabled | 禁用 | td |
| .am-disabled | 禁用 | tr |
| .am-primary | 蓝色高亮 | td |
| .am-primary | 蓝色高亮 | tr |
| .am-success | 绿色高亮 | td |
| .am-success | 绿色高亮 | tr |
| .am-warning | 橙色高亮 | td |
| .am-warning | 橙色高亮 | tr |
| .am-danger | 红色高亮 | td |
| .am-danger | 红色高亮 | tr |
其他效果
.am-table-striped斑马纹效果.am-table-hoverhover 状态
| 网站名称 | 网址 | 创建时间 |
|---|---|---|
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
<table class="am-table am-table-striped am-table-hover">
...
</table>
紧凑型
添加 .am-table-compact class,调整 padding 显示更紧凑的单元格。
| 网站名称 | 网址 | 创建时间 |
|---|---|---|
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI(Active) | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
<table class="am-table am-table-bordered am-table-striped am-table-compact">
<thead>
<tr>
<th>网站名称</th>
<th>网址</th>
<th>创建时间</th>
</tr>
</thead>
<tbody>
<tr>
<td>Amaze UI</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
<tr>
<td>Amaze UI</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
<tr class="am-active">
<td>Amaze UI(Active)</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
<tr>
<td>Amaze UI</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
<tr>
<td>Amaze UI</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
</tbody>
</table>
响应式表格
.am-text-nowrap: 禁止文字换行;.am-scrollable-horizontal: 内容超出容器宽度时显示水平滚动条。
以上两个 class 在「辅助类」中定义。
| -= 表格标题 =- | -= 表格标题 =- | -= 表格标题 =- | -= 表格标题 =- | -= 表格标题 =- | -= 表格标题 =- | -= 表格标题 =- | -= 表格标题 =- |
|---|---|---|---|---|---|---|---|
| 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 |
| 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 |
| 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 | 表格数据 |
<div class="am-scrollable-horizontal">
<table class="am-table am-table-bordered am-table-striped am-text-nowrap">
...
</table>
</div>
后续更新
2.4.x 新增
<table>上添加.am-table-centered实现单元格居中对齐- 单元格上添加
.am-text-middle可以实现垂直居中,同样,在单元格上添加其他文本对齐 class 可以实现想要的效果(参见辅助类)
| Savings for holiday! | Month | Savings |
|---|---|---|
| $50 | January | $100 |
| February | $80 |
<table class="am-table am-table-bordered am-table-centered">
<tr>
<th>Savings for holiday!</th>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td rowspan="2" class="am-text-middle">$50</td>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
所有样式叠加
| 网站名称 | 网址 | 创建时间 |
|---|---|---|
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI(Active) | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
| Amaze UI | http://amazeui.org | 2012-10-01 |
<table class="am-table am-table-bordered am-table-striped am-table-hover">
<thead>
<tr>
<th>网站名称</th>
<th>网址</th>
<th>创建时间</th>
</tr>
</thead>
<tbody>
...
<tr class="am-active">
<td>Amaze UI(Active)</td>
<td>http://amazeui.org</td>
<td>2012-10-01</td>
</tr>
...
</tbody>
</table>
参考资源
- [表格排序 jQuery Table Sort] (https://github.com/kylefox/jquery-tablesort)
- Tablesaw - A set of jQuery plugins for responsive tables
- FooTable - jQuery plugin to make HTML tables responsive
amazeui学习笔记--css(HTML元素5)--表格Table的更多相关文章
- amazeui学习笔记--css(HTML元素4)--图片image
amazeui学习笔记--css(HTML元素4)--图片image 一.总结 1.响应式图片:随着页面宽度而变化 .am-img-responsive class. <img src=&quo ...
- amazeui学习笔记--css(HTML元素3)--表单Form
amazeui学习笔记--css(HTML元素3)--表单Form 一.总结 1.form样式使用:在容器上添加 .am-form class,容器里的子元素才会应用 Amaze UI 定义的样式. ...
- amazeui学习笔记--css(HTML元素2)--代码Code
amazeui学习笔记--css(HTML元素2)--代码Code 一.总结 1.行内代码:code标签<code> 2.代码片段:pre标签<pre> 3.限制代码块高度:添 ...
- amazeui学习笔记--css(HTML元素1)--按钮Button
amazeui学习笔记--css(HTML元素1)--按钮Button 一.总结 1.button的基本使用:a.am-btn 在要应用按钮样式的元素上添加 .am-btn,b.颜色 再设置相应的颜色 ...
- amazeui学习笔记--css(基本样式3)--文字排版Typography
amazeui学习笔记--css(基本样式3)--文字排版Typography 一.总结 1.字体:amaze默认非 衬线字体(sans-serif) 2.引用块blockquote和定义列表:引用块 ...
- amazeui学习笔记--css(布局相关3)--辅助类Utility
amazeui学习笔记--css(布局相关3)--辅助类Utility 一.总结 1.元素清除浮动: 添加 am-cf 这个 class 即可 2.水平滚动: .am-scrollable-horiz ...
- amazeui学习笔记--css(布局相关1)--网格Grid
amazeui学习笔记--css(布局相关1)--网格Grid 一.总结 基本使用 1.div+class布局:amaze里面采取的就是div+class的布局方式 <div class=&q ...
- amazeui学习笔记--css(基本样式2)--基础设置Base
amazeui学习笔记--css(基本样式2)--基础设置Base 一.总结 1.盒子模型:外margin,内padding,这里的内外指的边框 2.border-box:Amaze UI 将所有元素 ...
- amazeui学习笔记--css(基本样式)--样式统一Normalize
amazeui学习笔记--css(基本样式)--样式统一Normalize 一.总结 1.统一浏览器默认样式: Amaze UI 也使用了 normalize.css,就是让不同浏览器显示相同的样式 ...
随机推荐
- 学习NLP:《自然语言处理原理与技术实现(罗刚)》PDF+代码
自然语言处理技术已经深入我们的日常生活.我们经常用到的搜索引擎就用到了自然语言理解等自然语言处理技术.自然语言处理是一门交叉学科,涉及计算机.数学.语言学等领域的知识. <自然语言处理原理与技术 ...
- 【Django】路由系统
目录 URLconf配置 正则表达式详解 分组命名匹配 命名URL 与 URL反向解析 @ *** Django 1.1版本 URLConf官方文档 URL配置(URLconf)就像Django所支撑 ...
- CSDN博客给我带来的一些诱惑和选择机会(二):HR“邀请于我”,猎头“有求于我”
上次,2013年10月8日 ,分享了一篇颇具"正能量"的文章CSDN博客给我带来的一些诱惑和选择机会,获得了很好的正面效果. 10月份,又发生了很多有趣.有意义的事情. 其中,有一 ...
- ajax和axios请求本地json数据对比
AJAX 是一种在无需重新加载整个网页的情况下,能够更新部分网页的技术,通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更新.这意味着可以在不重新加载整个网页的情况下,对网页的某部分进 ...
- Java 学习(13):抽象类& 抽象方法& 封装
目录 --- 抽象类 --- 封装 抽象类: 在面向对象的概念中,所有的对象都是通过类来描绘的,但是反过来,并不是所有的类都是用来描绘对象的,如果一个类中没有包含足够的信息来描绘一个具体的对象,这样的 ...
- Add Webhooks to Your API the Right Way
Add Webhooks to Your API the Right Way Adam DuVander / December 15, 2016 In the last 10 years, APIs ...
- bzoj1084【SCOI2005】最大子矩阵
1084: [SCOI2005]最大子矩阵 Time Limit: 10 Sec Memory Limit: 162 MB Submit: 1946 Solved: 970 [Submit][id ...
- 【Tika基础教程之中的一个】Tika基础教程
一.高速入门 1.Tika是一个用于文本解释的框架.其本身并不提供不论什么的库用于解释文本,而是调用各种各样的库,如POI,PDFBox等. 使用Tika.能够提取文件里的作者.标题.创建时间.正文等 ...
- Your Ruby version is 2.2.3, but your Gemfile specified 2.2.2
在文章 Ruby On Rails中REST API使用演示样例--基于云平台+云服务打造自己的在线翻译工具 中,从Bluemix上下载的初始Hello World演示样例代码在本地环境下运行调试时提 ...
- CentOS6.4安装Docker
首先,须要安装EPEL仓库 # wget http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm # rpm -ivh e ...