Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Generate Table

  1. #1
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Generate Table

    Hi,

    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?

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks in advance!

  • #3
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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+

  • #4
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    IE's insertAdjacentHTML method happens to perform much better than setting innerHTML, by the way...
    Thanks in advance!

  • #5
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good point and it works on FF

  • #6
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SpirtOfGrandeur
    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 yourself.
    *keep it simple (TM)

  • #7
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •