2014年4月25日 星期五

javascript-array jquery-each jquery-table


javascript-array
jquery-each-this
jquery-table-control

var textAligns = new Array();
var widths = new Array();
r=0
$('#maintable > tbody  > tr:first-child >td').each(function() {
textAligns[r]=$(this).css('textAlign');
widths[r++]=$(this).width();
});
r=0
$('#maintable > thead  > tr:first-child >th').each(function() {
$(this).css(textAligns[r]);
$(this).width(widths[r++]);
});

沒有留言:

張貼留言