Thursday, December 23, 2010

Javascript function for horizontal center align in asp.net

function SetDivPosition(tbl,hgt)
{
document.getElementById(tbl).style.height = ((document.body.clientHeight - hgt)/2) + "px";

}

//Call this function into the OnLoad() and OnResize() event of body tag.

No comments: