本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长


+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

2024-11(11)

uni-app uView Ui Table 合并单元格

发布于2022-03-19 00:22     阅读(3331)     评论(0)     点赞(25)     收藏(1)


Table 表格


本组件标签类似HTML的table表格,由table、tr、th、td四个组件组成

table 组件裹在最外层,可以配置一些基础参数

tr 组件用于显示"行"数据

th 组件用于显示表头内容,类似td,不同之处在于字体加粗了,也带有背景颜色,也可以直接用td替代th

td组件不是最小单位,为了合并单元格时,内部可以嵌入 tr 和 td 组件

效果图

在这里插入图片描述


Template 文件

<view class="table_box">
	<u-table>
                 <u-tr>
			<u-td width="25%">车辆种类</u-td>
			<u-td width="75%" class="box_br box_pd">
				<u-td width="80%" class="box_cus">月折旧系数</u-td>
                         <u-tr>
                         	<u-td class="box_bt">家庭自用</u-td>
                         	<u-td class="box_bt">非营业</u-td>
					<u-td width="50%" class="box_bt box_pd box_br">
						<u-td class="box_cus">营业</u-td>
						<u-tr >
							<u-td class="box_bt box_cus">1.10%</u-td>
							<u-td class="box_bt box_cus">0.90%</u-td>
						</u-tr>
					</u-td>
                         </u-tr>
			</u-td>	
		</u-tr>
                 <u-tr>
                 	<u-td class="box_cus" width="25%">9座以下客车</u-td>
                 	<u-td class="box_cus">0.60%</u-td>
                 	<u-td class="box_cus">0.60%</u-td>
                 	<u-td class="box_cus">1.10%</u-td>
                 	<u-td class="box_cus">0.90%</u-td>
                 </u-tr>
                 <u-tr>
                 	<u-td class="box_cus" width="25%">10座以下上客车</u-td>
                 	<u-td class="box_cus">0.90%</u-td>
                 	<u-td class="box_cus">0.90%</u-td>
                 	<u-td class="box_cus">1.10%</u-td>
                 	<u-td class="box_cus">0.90%</u-td>
                 </u-tr>
                 <u-tr>
                 	<u-td class="box_cus" width="25%">微型载货汽车</u-td>
                 	<u-td class="box_cus">/</u-td>
                 	<u-td class="box_cus">0.90%</u-td>
                 	<u-td class="box_cus">1.10%</u-td>
                 	<u-td class="box_cus">1.10%</u-td>
                 </u-tr>
                 <u-tr>
                 	<u-td class="box_cus" width="25%">带拖挂的载货汽车</u-td>
                 	<u-td class="box_cus">/</u-td>
                 	<u-td class="box_cus">0.90%</u-td>
                 	<u-td class="box_cus">1.10%</u-td>
                 	<u-td class="box_cus">1.10%</u-td>
                 </u-tr>
                 <u-tr>
                 	<u-td class="box_cus" width="25%">低速货车和三轮汽车</u-td>
                 	<u-td class="box_cus">/</u-td>
                 	<u-td class="box_cus">1.10%</u-td>
                 	<u-td class="box_cus">1.40%</u-td>
                 	<u-td class="box_cus">1.40%</u-td>
                 </u-tr>
                 <u-tr>
                 	<u-td class="box_cus" width="25%">其他车辆</u-td>
                 	<u-td class="box_cus">/</u-td>
                 	<u-td class="box_cus">0.90%</u-td>
                 	<u-td class="box_cus">1.10%</u-td>
                 	<u-td class="box_cus">0.90%</u-td>
                 </u-tr>
	</u-table>
</view>

Style 文件

.table_box{
	.box_bt{
		border-bottom: unset !important;
	}
	.box_pd{
		padding: unset !important;
	}
	.box_br{
		border-right: unset !important;
	}
	.box_cus{
		padding: 10px 3px !important;
	}
	/deep/ .u-td[data-v-35ace0c0]{
		height: auto;
	}
}



所属网站分类: 技术文章 > 博客

作者:强哥你们辛苦了

链接:http://www.qianduanheidong.com/blog/article/318655/eb9f42894508333089e7/

来源:前端黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

25 0
收藏该文
已收藏

评论内容:(最多支持255个字符)