View Full Version : Can tables be positioned on the fly?
tired&lonely
09-25-2002, 12:32 PM
Ok, this is probably a really stupid question, but... Is there a way to have a table inserted multiple times in a webpage ON THE FLY (that is, as the webpage is loaded)? For instance, suppose we have a table like this, and a body of code which FOLLOWS it:
<table id="blah"> {a bunch of text and other stuff} </table>
<body>
content
content
content
{insert first instance of table "blah"}
content
content
content
{insert second instance of table "blah"}
content
content
{insert third instance of table "blah"}
etc. etc.
</body>
:confused:
You can't clone it with HTML alone.
Either you'll need to use a server side language like php:
<body>
content
content
<?php echo "$tablestuff";?>
content
content
<?php echo "$tablestuff";?>
content
content
<?php echo "$tablestuff";?>
</body>
Or use DOM1 cloneNode(true), and appendChild() on page load, but that is IE5+/NS6+-only for now.
tired&lonely
09-25-2002, 08:36 PM
Thanks, jkd. Are these then the only two solutions if I just want to insert ONE instance of the table (I'm trying to try to make this compatible with pre-IE5+/NS6)? In other words, other than using relative positioning (which would render a blank space where the table was coded within the source code), is there any way to have a table rendered in a different place than were it was coded within the source code? For instance:
Say, the source code would have THIS order:
<body>
<table id="blah"> {a bunch of text and other stuff} </table>
content
content
content
content
content
content
</body>
But then the webpage would look like this:
<body>
content
content
content
<table id="blah"> {a bunch of text and other stuff} </table>
content
content
content
</body>
:confused:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.