// Obtain the table object
VaR tabobj = Document. getelementbyid ("tabtipresult ");
// Number of rows in the current table
VaR rowcount = tabobj. Rows. length;
// Number of columns in each row
VaR cellcount = tabobj. Rows (0). cells. length;
If (rowcount <pagecount)
{
For (VAR I = 0; I <pagecount; I ++)
{
// Add a new row to the table cyclically
VaR newrow = tabobj. insertrow (rowcount ++ );
For (var j = 0; j <cellcount; j ++)
{
// New column values in each row
Newrow. insertcell (j). innerhtml = "NONE ";
}
}
}
Else
{
For (VAR I = 1; I <= pagecount; I ++)
{
VaR tmprow = tabobj. Rows (I );
For (var j = 0; j <cellcount; j ++)
{
Tmprow. cells (j). innerhtml = "NONE ";
}
// The background color attribute of the row
Tmprow. onmouseout = function () {This. bgcoloR = "white ";};
Tmprow. onmouseover = function () {This. bgcolor = "# efffff ";};
// TD in onclick event
Tmprow. cells (0). onclick = function () {alert ("");};
}
}
Delete column
Document. getelementbyid (tabtipresult). deleterow (INDEX );
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.