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,就是让不同浏览器显示相同的样式 ...
随机推荐
- nginx编译安装选项说明
configure 脚本确定系统所具有一些特性,特别是 nginx 用来处理连接的方法.然后,它创建 Makefile 文件. configure 支持下面的选项: –prefix= <path ...
- 紫书 习题 10-25 UVa 1575 (有重复元素的全排列+暴搜)
我一开始以为有什么很牛逼的方法来做,然后一直没有思路 后来看了https://blog.csdn.net/zju2016/article/details/78562932的博客 竟然是暴搜?????? ...
- Spring MVC原理及实例基础扫盲篇
近期 项目中刚接触了SpringMVC,就把这几天看的跟实践的东西写出来吧. 一.首先,先来了解一下SpringMVC究竟是个什么样的框架? Spring Web MVC是一种基于Java的实现了We ...
- Outlook中设置会议的提醒
https://support.office.com/en-us/article/Set-or-remove-reminders-7a992377-ca93-4ddd-a711-851ef359792 ...
- JSP从选择到放弃
JSP为什么会出现?出现的原因? ①因为在开发web网站时候,返现servlet做界面比较麻烦,于是出现了jsp. 运行在服务端(Java server pages)基于servlet,对servle ...
- IBM Tivoli Netview在企业网络管理中的实践(附视频)
今天我为大家介绍的一款高端网管软件名叫IBM Tivoli NetView,他主要关注是IBM整理解决方案的用户,分为Unix平台和Windwos平台两种,这里视频演示的是基于Windows 2003 ...
- 应用Linux远程桌面(附视频)
650) this.width=650;" border="0" alt="" src="http://img1.51cto.com/att ...
- EF中执行Sql语句
Entity Framework是微软出品的高级ORM框架,大多数.NET开发者对这个ORM框架应该不会陌生.本文主要罗列在.NET(ASP.NET/WINFORM)应用程序开发中使用Entity F ...
- 解决xorm逆向mssql报datetime2不兼容的异常错误
xorm作为golang开发者的一大利器,深受大家的喜爱,可是最近在逆向mssql的时候,报了这么一个错误: 最后找了半天发现xorm没有预置DateTime2类型,经过几番折腾,在xorm源码的en ...
- iOS动画之模拟音量振动条
音量振动条 效果图: 假设实现? 创建3个layer.按顺序播放y轴缩放动画 利用CAReplicatorLayer实现 1.什么是CAReplicatorLayer? 一种能够复制自己子层的laye ...