/    Sign up×
Community /Pin to ProfileBookmark

Hiding and Showing a table??

Hey guys I don’t know if this can be done but thought I would ask. My site is at [url]www.digitaleyesandears.com[/url] and I want to be able to hide/show that bottom table with a mouse click. I got this idea from dailysnap.com. (If you click on the top plus sign you will see what I mean) I know he uses javascript but I didn’t know if there is another way of doing that for a table?? Any ideas guys?

Thanks sooo much

adam

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinJan 29.2006 — try this:

[CODE]
<a href="#" onclick="javascript: document.getElementById('divTable').style.display=(document.getElementById('divTable').style.display=='none')?'block':'none'">+</a>
<div id="divTable" style="display:none">Your Table Here</div>
[/CODE]
Copy linkTweet thisAlerts:
@CrazyMerlinJan 29.2006 — style.display =='none' remove that space, the site put it in, not me
Copy linkTweet thisAlerts:
@ciscoguy24authorJan 29.2006 — style.display =='none' remove that space, the site put it in, not me[/QUOTE]


Hey Crazymerlin thanks for your help. Its working some... It isn't "hiding" the table and when you click on the plus sign it drops down the table below the viewport. When you go to the page it displays the black background of the table.

Any ideas?

Thanks
Copy linkTweet thisAlerts:
@ciscoguy24authorJan 29.2006 — Hey Crazymerlin thanks for your help. Its working some... It isn't "hiding" the table and when you click on the plus sign it drops down the table below the viewport. When you go to the page it displays the black background of the table.

Any ideas?

Thanks[/QUOTE]


Ok guys I got this working but I want the "menu" to be right in the center of the page and also when the thing drops down I do not want it going pass the viewport. any ideas? Basiaclly I need the "menu" to be right under the black box so there is room for the dropdown ?


adam
Copy linkTweet thisAlerts:
@CrazyMerlinJan 30.2006 — where you have that first div, the one with the + in it, get rid of it.

just have the <a> and put it inside <center></center> tags

the div gives itself some space and so your menu gets pushed down.
Copy linkTweet thisAlerts:
@gurujrMar 22.2006 — I read what you said to do for a link of a table, I am trying to do the same with a bigger document then that, the javascript I found didnt work for it for some reason.

Here is my javascript and source code for some of the document:

Javascript:

function show_section(e) {

if (document.getElementById(e).style.display == 'none') {

document.getElementById(e).style.display = 'block';

} else {

document.getElementById(e).style.display = 'none';

}

}


function expand()

{

var Nodes = document.getElementsByTagName("table")

var max = Nodes.length

for(var i = 0;i < max;i++) {

var nodeObj = Nodes.item(i)

var str = nodeObj.id

if (str.match("section")) {

nodeObj.style.display = 'block';

}

}

}

function hideall()

{

var Nodes = document.getElementsByTagName("table")

var max = Nodes.length

for(var i = 0;i < max;i++) {

var nodeObj = Nodes.item(i)

var str = nodeObj.id

if (str.match("section")) {

nodeObj.style.display = 'none';

}

}

}

Some of the source code:

<tr>

<td class="bylaws_pointer" onclick="show_section('section2')"><p />

Article II : Purpose </td>

</tr>

<tr>

<td><table align="center" width="100%" cellspacing="0" cellpadding="0" id="section2" border="0">

<tr>

<td><p />

The purpose of the Association shall be to provide a forum for the youth leadership of the Venturing Crews of Chester County Council, to provide Venturing program support to crews through the district officers, to promote Venturing and its programs, to assist the district Roundtable Commissioners and staffs upon request, and also to provide a variety of program and training events for youth all across the Council. </td>

</tr>

</table></td>

</tr>
×

Success!

Help @ciscoguy24 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...