Skip to content

Alignment of head and body width 对齐表头和表体宽度 #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions js/jquery.CongelarFilaColumna.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,30 @@
tabla = this,
contenedor = $(this).parent(),
classT = $tabla.attr("class");


//Copy thead and its width height 复制thead及其宽高
var newTead = $("<thead></thead>");
var $oldTableTr = $tabla.find("thead").find("tr");
for(var i = 0; i < $oldTableTr.length; i++) {
var newTr = $("<tr></tr>");
var $oldTableTh = $oldTableTr.eq(i).find("th");
for(var j = 0; j < $oldTableTh.length; j++) {
var oidTd = $oldTableTh.eq(j);
var newTd = oidTd.clone();
newTd.height(oidTd.height());
newTd.width(oidTd.width());
newTr.append(newTd);
newTr.css({
'display': 'table-row'
})
}
newTead.append(newTr);
}

helpers._ObtenerAsignarAnchoAlto($tabla);

var thead = $tabla.find("thead").clone(),
//var thead = $tabla.find("thead").clone(),
var thead = newTead,
anchotabla = $tabla.width(),
tablaTH = $("<table>").attr("class",classT).append(thead),
$tablaTHCol = $("<table>").attr("class",classT).append($("<thead>")),
Expand Down Expand Up @@ -630,4 +650,4 @@
$.error('El Método "' + method + '" No existe en el plugin CongelarFilaColumna! :( ');

}
})(jQuery);
})(jQuery);