By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,970 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,970 IT Pros & Developers. It's quick & easy.

DHTML issue, div, positioning

P: n/a
Hello

I have two tables in a page as:

<span id="id1">
<table>
.....
</table>
</span>

<span id="id2">
<table>
.....
</table>
</span>

I want to write a javascript function that allows me to show one table at a
time. The table that is shown should always be displayed where the first
table is rendered.

Now AFAIK, this can be done through setting a "position" style and then
playing with each ID's top/left attributes.
Is there is any way to position the layer wherever I want based on a
rendered item?

I hope my question was clear.

--
Elias
Aug 28 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
lallous wrote:
I have two tables in a page as:
<span id="id1">
<table>
Invalid markup. <span> elements cannot contain <table> elements. Invalid
markup is a shaky foundation to try to build scripting on. I strongly
suggest you make use of http://validator.w3.org/
I want to write a javascript function that allows me to show one table at
a time.
Give the tables an id each. Access them with document.getElementById().
Toggle their .style.display property between "" and "none".
Now AFAIK, this can be done through setting a "position" style and then
playing with each ID's top/left attributes.
That makes things overly complicated and error prone. You don't need to do
this to achieve the stated goal.
Is there is any way to position the layer
The what? http://dorward.me.uk/www/layers/
wherever I want based on a rendered item?
I'm not quite sure you are saying here, but I think the answer is "No, but
you can achieve the goal you stated at the beginning easily enough."
--


Please fix your sig separator. It should be two dashes (which you have)
followed by a space (which you don't have) and *then* the new line. Decent
newsreaders can automatically drop correctly written sigs from quoted
material.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Aug 28 '05 #2

P: n/a
Hello David,

Thanks, yes, playing w/ the display attribute rather than the visibility
reaches the goal.

And thanks for the other remarks.

--
Elias
"David Dorward" <do*****@yahoo.com> wrote in message
news:de*******************@news.demon.co.uk...
lallous wrote:
I have two tables in a page as:
<span id="id1">
<table>


Invalid markup. <span> elements cannot contain <table> elements. Invalid
markup is a shaky foundation to try to build scripting on. I strongly
suggest you make use of http://validator.w3.org/
I want to write a javascript function that allows me to show one table at
a time.


Give the tables an id each. Access them with document.getElementById().
Toggle their .style.display property between "" and "none".
Now AFAIK, this can be done through setting a "position" style and then
playing with each ID's top/left attributes.


That makes things overly complicated and error prone. You don't need to do
this to achieve the stated goal.
Is there is any way to position the layer


The what? http://dorward.me.uk/www/layers/
wherever I want based on a rendered item?


I'm not quite sure you are saying here, but I think the answer is "No, but
you can achieve the goal you stated at the beginning easily enough."
--


Please fix your sig separator. It should be two dashes (which you have)
followed by a space (which you don't have) and *then* the new line. Decent
newsreaders can automatically drop correctly written sigs from quoted
material.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

Aug 29 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.