473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1159
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
2
by: RWD | last post by:
I am trying to figure out how to change the target frame in my hyperlink on a DHTML menu. The menu is in one frame and the target frame is called "main" The code is below: Thanks in advance...
6
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> ...
4
by: bbass | last post by:
thanks to all that replyied to my previous post with the following code in question: <a href="merc.htm" target="_new_merc" onfocusout=window.close class="left_link"> i understand that the...
5
by: Antonio Ooi | last post by:
Hi, I'm an application developer from Malaysia. I wanted to know how ASP.NET server-side events vs. client-side DHTML for FORM manipulations, may be in terms of performance and practicality? To...
20
by: cwdjrxyz | last post by:
There have been fancy dhtml text effects since the early days of javascript. The rainbow text effect was one of the early ones. While some such effects may be fun on private pages, they can easily...
4
by: darwinist | last post by:
1 Works in a browser as customisable web-interface or, 2 Use with apache to make window-based, dhtml-apps 3 Rename/retitle open windows 4 Arbitrary virtual desktop size with easy navigation...
1
by: gubusoft | last post by:
I have a Web page with two frames. The left frame has a DHTML-generated tree of links (to images). The right frame displays the image link you click in the tree of links. It works great on...
9
by: ninhovid | last post by:
Hi... i'm new at dhtml, and i want to use it in help windows (instead of window.open() of javascript)... i'm done it... but it works only in internet explorer.. in firefox 2 and 3 it opens the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.