CSS表格

border-collapse 属性设置是否将表格边框折叠为单一边框  border-spacing 属性设置相邻单元格的边框间的距离

border-style:dotted solid double dashed;//上 右 下 左  border-style:dotted solid double;//上 右左 下  border-style:dotted solid;//上下 右左   可以属性值:solid/double/dashed/dotted/groove/ridge/inset/outset/inherit

text-align 属性设置 <th> 或 <td> 中内容的水平对齐方式(左、右或居中)  vertical-align 属性设置 <th> 或 <td> 中内容的垂直对齐方式(上、下或居中)

padding 控制边框和表格内容之间的间距

悬停表格 tr:hover {background-color: #f5f5f5;}  条状表格 tr:nth-child(even) {background-color: #f2f2f2;}

caption-side:bottom/top/inherit 属性设置表格标题的位置

在 <table> 元素周围添加带有 overflow-x:auto 的容器元素(例如 <div>),以实现响应式效果:
<div style="overflow-x:auto;">

<table>
... table content ...
</table>

</div>

原文地址:https://www.cnblogs.com/geryhz/p/15344014.html