Click to See Complete Forum and Search --> : Table Info


tommy lim
04-15-2003, 03:56 AM
Hi,

I have this javascript. It's suppose to grab all the tables i have and insert style.pageBreakBefore='Always' onto it.
Basically, after this i will do some calculation for the pagination thingy. I encounter error at a particular line. See below

Thanks.

Tommy

function fn_get_table()
{
myDocumentElements=document.getElementsByTagName("table");
var mystring
for (var n=0; n < myDocumentElements.length; n++)
{
mystring = n + '';

//error below.
document.all('Table' + mystring).style.pageBreakBefore='Always';
}
}

tommy lim
04-15-2003, 04:19 AM
Hey dude,

I solve the javascript error.
i need this code inside the for loop.

if (n == myDocumentElements.length-2)
{
return false;
}

Cheers... Looking bright now.
Tommy