首页 > 其他 > 详细

表格样式

时间:2021-05-30 10:52:13      阅读:19      评论:0      收藏:0      [点我收藏+]

表格默认样式

Hbuilder 创建表格小技巧 tr > td{$}*5

<table border="1" width="500" height="200" rules="groups">
		<thead>
		<tr>
			<th>1</th>
			<th>2</th>
			<th>3</th>
		</tr>
		</thead>
		<tbody>
		<tr>
			<td>1</td>
			<td>2</td>
			<td>3</td>
		</tr>
		<tr>
			<td>1</td>
			<td>2</td>
			<td>3</td>
		</tr>
		</tbody>
		<tfoot>
		<tr>
			<td>1</td>
			<td>2</td>
			<td>3</td>
		</tr>
		</tfoot>
	</table>
<!--
		一个完整的表格组成:
		table
		tr
		th 表格的表头标题
		td
		
		行分组:
		thead 表头
		tbody 标体 注意点:tbody不设置的时候,浏览器会默认设置
		tfoot 表尾
		行分组可以让表格的结构更加清晰合理
	-->

技术分享图片

cellspacing

表格的边框比较粗

<table border="1" width="500" rules="" cellspacing="0">

技术分享图片

rules

表格的边框比较细

table border="1" width="500" height="200" rules="all"></table>

技术分享图片

<table border="1" width="500" height="200" rules="cols"></table>

技术分享图片

<table border="1" width="500" height="200" rules="rows"></table>

技术分享图片

<table border="1" width="500" height="200" rules="groups"></table>

技术分享图片

列分组

<colgroup span="2" style="background-color: yellow;"></colgroup>

<col span="2" style="background-color: #FF0000;" />

技术分享图片

caption 标题属性

border-spacing 表格间隙

margin:50px auto; 表格居中

border-collapse: collapse; 合并单元格边框

text-align: 表格文字居中

table-layout:fix 表格固定 数字和字母在页面中不能默认换行,中文会换行

colspan="3" 合并单元格

rowspan="3"合并行

empty-cells: hide 无内容时隐藏

表格样式

原文:https://www.cnblogs.com/sehnen/p/14827042.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!