uniapp 合并单元格
时间: 2023-09-09 13:06:14 浏览: 437
在uniapp中合并单元格,可以使用rowspan和colspan属性来实现。在代码中,可以通过设置rowspan和colspan的值来控制每个单元格的合并行数。举个例子,可以设置uni-th元素的rowspan属性为3来表示该单元格要合并3行,colspan属性为2来表示该单元格要合并2列。示例代码如下:
```
<uni-tr>
<uni-th class="title" rowspan="3" align="center">尺寸</uni-th>
<uni-th class="title" rowspan="2" colspan="2" align="center">基础价格</uni-th>
<uni-th v-if="item.update_status" class="title" colspan="2" align="center">xxxxx</uni-th>
</uni-tr>
<uni-tr>
<uni-th v-if="item.update_status" class="title red normal" colspan="2" align="center">xxxxx</uni-th>
</uni-tr>
```
通过设置rowspan和colspan属性,可以实现对单元格的合并操作。这样可以达到uniapp中合并单元格的效果。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [vue通过数据过滤实现表格合并](https://download.csdn.net/download/weixin_38682790/14814175)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [uniapp uni-table表格组件 合并单元格](https://blog.csdn.net/qq_17627195/article/details/130227353)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)