:: Forum >>

How to print the elements of a table...

I read some posts here and figured out that I can print the elements of a table without putting it in a grid...but now I am not able to position the data. I get a screen refresh and it prints the data on the next page.

Here is the script...it does not matter where I put it, the data comes up on a fresh page:

function LoadData()
var table = new Active.XML.Table;

// provide data URL

// start asyncronous data retrieval

var defaultResponse = table.response;

table.response = function(data){
defaultResponse.call(this, data);
document.write('<table width="60%">');

for (i = 0; i <table.getCount(); i++){

document.write('<td width="50%" bgcolor="#FFFF99" height="21">'+table.getText(i,0)+'</td>');
document.write('<td width="50%" bgcolor="#FFFF99" height="21">',i,'</td>');


Friday, April 15, 2005
You can use document.write() only during page load (before browser gets final </html> tag). If you call document.write() AFTER the page load, it is equivalent to document.open(); document.write(), which means you start new blank page and write data there.

If you want to add/replace something on the existing page - use element.innerHTML
Alex (ActiveWidgets)
Monday, April 18, 2005

This topic is archived.

Back to support forum

Forum search