Can any1 explain the code in the post

Posted by Anumary under jQuery on 4/2/2012 | Points: 10 | Views : 832 | Status : [Member] | Replies : 0
function UpdateTableProps() {
var $firstTableHeadSection = $("#firstTableHeadSection");
var $firstTableBodySection = $("#firstTableBodySection");
var $firstTableBodySection1 = $("#firstTableBodySection1");
var $firstTableBodySection2 = $("#firstTableBodySection2");
var $firstTableBodySection3 = $("#firstTableBodySection3");
var $firstTableBodySection4 = $("#firstTableBodySection4");
var $bottom_firstTableBodySection = $("#bottom_firstTableBodySection");
var $AdjustmentSection_inputsec = $("#AdjustmentSection_inputsec");
var $firstTableTotalBodySection1 = $("#firstTableTotalBodySection1");
var $firstTableTotalBodySection2 = $("#firstTableTotalBodySection2");
var $firstTableTotalBodySection3 = $("#firstTableTotalBodySection3");

//for repeted table section
var $firstTableHeadSection_again = $("#firstTableHeadSection_again");
var $firstTableBodySectio_again = $("#firstTableBodySection_again");
var $bottom_firstTableBodySection_again = $("#bottom_firstTableBodySection_again");

var tableWidth = 0;
$firstTableHeadSection_again.find("td:visible").each(function (index) {
//alert(parseInt($(this).css("padding-right").replace("px","")));
var colWidth = $(this).width();
tableWidth += colWidth;
$firstTableBodySectio_again.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
$bottom_firstTableBodySection_again.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
});
//for repeted table section end

//for first table section
var tableWidth = 0;
$firstTableHeadSection.find("td:visible").each(function (index) {
//alert(parseInt($(this).css("padding-right").replace("px","")));
var colWidth = $(this).width();
tableWidth += colWidth;
$firstTableBodySection.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
$firstTableBodySection1.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
$firstTableBodySection2.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
$firstTableBodySection3.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
$firstTableBodySection4.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
$bottom_firstTableBodySection.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
$AdjustmentSection_inputsec.find("tr:first td:eq(" + index + ")").css("width", colWidth + "px");
});

}




Responses

(No response found.)

Login to post response