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-hover
hover 状态
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-hover
hover 状态
网站名称 | 网址 | 创建时间 |
---|---|---|
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,就是让不同浏览器显示相同的样式 ...
随机推荐
- 玩转 Jupyter Notebook (CentOS)
Jupyter Notebook 简介 Jupyter Notebook 是一个开源的 Web 应用程序,可以用来创建和共享包含动态代码.方程式.可视化及解释性文本的文档.其应用于包括:数据整理与转换 ...
- valgrind的说明使用和原理
编译 #gcc -g -o test test.c 内存检查#valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./test ...
- CF(438D) The Child and Sequence(线段树)
题意:对数列有三种操作: Print operation l, r. Picks should write down the value of . Modulo operation l, r, x. ...
- html元素的分类有哪些?
今天零度给大家讲一下基本的html元素分类: HTML元素的分类其实主要有两种元素构成——块级元素和内联元素. html元素的分类有块级元素和行内元素 一.块级元素(block)的特点: 1.总是在新 ...
- 企业实战之部署Solarwinds Network八部众
企业实战之部署Solarwinds Network 网管系统八部众 Orion Network Performance Monitor是全面的带宽性能监控和故障管理软件,能监控并收集来自路由器.交换机 ...
- [置顶]
Docker学习总结(2)——Docker实战之入门以及Dockerfile(二)
csphere/php-fpm:5.4 # cd docker-training/php-fpm/ # ls Dockerfile nginx_nginx.conf supervisor_nginx. ...
- POJ——T 2406 Power Strings
http://poj.org/problem?id=2406 Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 50627 ...
- jquery--new返回值
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...
- javascript创建对象的方法--动态原型模式
javascript创建对象的方法--动态原型模式 一.总结 1.作用:解决组合模式的属性和函数分离问题 2.思路:基本思路和组合模式相同:共用的函数和属性用原型方式,非共用的的函数和属性用构造函数 ...
- 72.挖掘CSDN密码到链表并统计密码出现次数生成密码库
list.h #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include & ...