View Full Version : Generate Table

07-13-2005, 03:01 AM

I have a function called DoMath with lots of variables and calculations, in particular, 2 variables called "numberoutofsheethigh" and "numberoutofsheetwide". I want to now create a visual view of this by generating a table which calls the value from "numberoutofsheetwide" and makes that many columns in the table, and to call the value from "numberoutofsheethigh" and make that many rows in the table. And it has to update if the variables in the DoMath function change.
Can anyone help me?

07-13-2005, 10:08 AM
How to Build Tables Dynamically (http://msdn.microsoft.com/workshop/author/tables/buildtables.asp)

07-13-2005, 02:04 PM
I have read and tested (I dont remember the URL) and there are two different ways to create tables based on the browser (talking only IE and FF). FF creates tables really fast if using the DOM. While IE struggles. IE also struggles with the link that enumerator gave you for large tables. In order to create large tables in IE you need to create one long string of all the information and apply it to the innerHTML of an object. It is the fastest way to create a table in IE using IE5.0+

07-13-2005, 02:11 PM
IE's insertAdjacentHTML method happens to perform much better than setting innerHTML, by the way...

07-13-2005, 02:35 PM
Good point and it works on FF :)

07-13-2005, 03:09 PM
Good point and it works on FF

insertAdjacentHTML doesn't exist in FF. are you not thinking of insertBefore? in anycase you can create the method (http://www.faqts.com/knowledge_base/view.phtml/aid/5756) yourself. :D

07-13-2005, 08:59 PM
No I was reading a website that I had created that used it. Unfortunately it overrode the Element.prototype.insertAdjacentHTML and I just plain forgot that I had that JS. My bad!