jquery colspan rowspan
来源:互联网 发布:mac单windows系统 编辑:程序博客网 时间:2024/05/17 01:18
$.fn.extend({
//表格合并单元格,colIdx要合并的列序号,从0开始
"rowspan": function (colIdx,thOrtd) {
if(!thOrtd){
thOrtd='td';
}
return this.each(function () {
var that;
$('tr', this).each(function (row) {
$(thOrtd+':eq(' + colIdx + ')', this).filter(':visible').each(function (col) {
if (that != null && $(this).html() == $(that).html()) {
rowspan = $(that).attr("rowSpan");
if (rowspan == undefined) {
$(that).attr("rowSpan", 1);
rowspan = $(that).attr("rowSpan");
}
rowspan = Number(rowspan) + 1;
$(that).attr("rowSpan", rowspan);
$(this).hide();
} else {
that = this;
}
});
});
});
}
});
})(jQuery);
(function ($) {
$.fn.extend({
//表格行合并单元格,rowIdx要合并的行序号,从0开始
"colspan": function (rowIdx,thOrtd) {
if(!thOrtd){
thOrtd='td';
}
return this.each(function () {
var that;
$(this).find('tr:eq(' + rowIdx + ')').find(thOrtd).each(function(col){
if (that != null && $(this).html() == $(that).html()) {
colspan = $(that).attr("colspan");
if (colspan == undefined) {
$(that).attr("colspan", 1);
colspan = $(that).attr("colspan");
}
colspan = Number(colspan) + 1;
$(that).attr("colSpan", colspan);
$(this).hide();
} else {
that = this;
}
});
});
}
});
})(jQuery);
- jquery colspan rowspan
- jquery还原含有rowspan、colspan的table
- jquery datatables rowspan和colspan 出错
- colspan, rowspan
- jQuery colspan and rowspan table using cell break
- colspan和rowspan
- colSpan rowspan 随记
- table colspan rowspan
- colspan和rowspan
- colspan rowspan学习
- colspan和rowspan
- colspan和rowspan
- rowspan 和 colspan
- rowspan和colspan使用
- HTML table tr colspan rowspan
- colspan和rowspan的用法
- table中的colspan和rowspan
- 表格,合并单元格colspan,rowspan
- rpm包制作之——mysql-5.7.16
- Java系列笔记 - Java 类加载与初始化
- 文章标题
- Java实现一个简单的RPC框架(五) 基于Socket的传输层实现
- android-屏幕适配
- jquery colspan rowspan
- LINUX C中如何定义可变参数的宏
- JAVA中CLASS.FORNAME的含义
- 利用CSS的transform旋转制作折扇效果
- 不同窗口自动设置输入法
- 39 leetcode - Combination Sum II
- android-判断当前Fragment是否可见(Visible)
- 高速公路ETC卡签之我见3-卡片圈存
- jQuery基础---过滤器