网站首页 > 教程文章 正文
利用<table>的原生组件<td>多列展示实现横向排列,具体代码如下
valign="top" 该属性不加会导致排列的表格错行
<table>
<tr>
<td valign="top" v-for="(item,index) of dataList">
<a-table
:ref="index"
rowKey="id"
:columns="[
{title: item.title, align: 'center',width:150,dataIndex: 'name'},
{title: item.title, align: 'center',width:150,dataIndex: 'id'}
]"
:dataSource="item.data"
:pagination = false
:customRow="customRow"
>
</a-table>
</td>
</tr>
</table>
使用的数据格式为
[
{
title: '第一个表',
data: [
{
name:"名字1",
id:"111111"
},
{
name:"名字2",
id:"22222"
}
]
},
{
title: '第二个表',
data: [
{
name:"名字1",
id:"33333"
},
{
name:"名字2",
id:"4444"
}
]
},
{
title: '第三个表',
data: [
{
name:"名字1",
id:"55555"
},
{
name:"名字2",
id:"66666"
}
]
}
]
最终效果
猜你喜欢
- 2025-07-24 使用Vue Query进行高级数据获取(vue中query)
- 2025-07-24 用vue3.2+ts+element搭建了个后台框架,却没有项目给我做
- 2025-07-24 基于SpringBoot+VUE实现博客系统(springboot加vue开发)
- 2025-07-24 分享15个基于Vue3.0全家桶的优秀开源项目
- 2025-07-24 Vue3 + Vite + Ts 开发必备的 VSCode 插件
- 2025-07-24 基于vue + element的后台管理系统解决方案
- 2025-07-24 如何用Vue3打造一个交互式待办事项列表和日历
- 2025-07-24 深入浅出虚拟 DOM 和 Diff 算法,及 Vue2 与 Vue3 中的区别
- 2025-07-24 推荐一个 Spring Boot 3 + Vue 3 的学习型开源项目,配备保姆级项目教程
- 2025-07-24 vue添加换行效果(vue中字符串加换行符)
- 最近发表
- 标签列表
-
- location.href (44)
- document.ready (36)
- git checkout -b (34)
- 跃点数 (35)
- 阿里云镜像地址 (33)
- qt qmessagebox (36)
- mybatis plus page (35)
- vue @scroll (38)
- 堆栈区别 (33)
- 什么是容器 (33)
- sha1 md5 (33)
- navicat导出数据 (34)
- 阿里云acp考试 (33)
- 阿里云 nacos (34)
- redhat官网下载镜像 (36)
- srs服务器 (33)
- pico开发者 (33)
- https的端口号 (34)
- vscode更改主题 (35)
- 阿里云资源池 (34)
- os.path.join (33)
- redis aof rdb 区别 (33)
- 302跳转 (33)
- http method (35)
- js array splice (33)