469,271 Members | 1,484 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

DHTML issue, div, positioning

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
2 1089
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
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.

Similar topics

4 posts views Thread by Jane Withnolastname | last post: by
2 posts views Thread by RWD | last post: by
5 posts views Thread by Antonio Ooi | last post: by
20 posts views Thread by cwdjrxyz | last post: by
4 posts views Thread by darwinist | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.