如何在数据表中合并行距? [英] How to colspan rowspan in Datatables?

查看:126
本文介绍了如何在数据表中合并行距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将colspanrowspan属性与jQuery Datatables一起使用,其中产品sku可以跨越2行,一周可以跨越2列,从而创建一个看起来像这样的表.

I am trying to use colspan and rowspan attributes with jQuery Datatables where a product sku can span 2 rows and a week can span 2 columns creating a table that looks like this.

这可能吗?

推荐答案

jQuery DataTables在表头中支持ROWSPANCOLSPAN属性,只要每一列至少有一个单元格即可.有关更多详细信息和演示,请参见复杂标题示例.

jQuery DataTables supports ROWSPAN and COLSPAN attributes in the table header as long as there is at least one cell for each column. See Complex header example for more details and demonstration.

jQuery DataTables插件默认不支持表主体中的ROWSPANCOLSPAN属性.

jQuery DataTables plug-in doesn't support ROWSPAN and COLSPAN attributes in the table body by default.

但是对于jQuery数据表,有一个 RowsGroup 插件可以将单元格组合在一起以使其看起来就像使用ROWSPAN属性一样.

However there is a RowsGroup plugin for jQuery DataTables that groups cells together to make them look like as if ROWSPAN attribute is used.

有关代码和演示,请参见此示例.

See this example for code and demonstration.

请参见 jQuery DataTables –表主体中的ROWSPAN TBODY 以获取更多详细信息.

See jQuery DataTables – ROWSPAN in table body TBODY for more details.

这篇关于如何在数据表中合并行距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆