Jul 20, 2008

How Can I Close And Open Tables

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > Java, Java Servlets, Java Script, & JSP

free web hosting

How Can I Close And Open Tables

faceofdie
Hi
How can i open and close tables like this site
www.ashiyane.com
the right and left table has Plus Jpg and when you click on the table close ?
Plz Help me
thank

Reply

no9t9
QUOTE(faceofdie @ Dec 31 2004, 08:16 AM)
Hi
How can i open and close tables like this site
www.ashiyane.com
the right and left table has Plus Jpg and when you click on the table close ?
Plz Help me
thank
*



you should use a DIV to hold the information in the table and give it a name. That div can be "collapsed" by changing the HEIGHT property through javascript.

CODE

<table border=1>
<tr><td><img src="arrowup.gif" id=arrow onclick="collapse();"></td></tr>
<tr><td><div id=div1 style="height:100px;overflow:auto">Your info here</div></td></tr>
</table>


you have to use java script to create the function "collapse" that is called using the "onclick" event for the arrow image.

in the javascript function you have to change the height of the DIV (named "div1" in this case) and also change the arrow image (named "arrow")

CODE

<script>
var originalwindowsize=100;
function collapse() {
if (document.all.div1.style.height != "1px") {
 originalwindowsize=parseInt(document.all.div1.style.height);
 document.all.div1.style.height=1;
 document.all.div1.style.overflow="hidden";
 document.all.arrow.src="arrowdown.gif"; }
else {
 document.all.div1.style.height=originalwindowsize;
 document.all.div1.style.overflow="auto";  
 document.all.arrow.src="arrowup.gif"; }}
</script>


This code will only work in IE (document.all)... I will let you figure out the equivalent for netscape/firefox/etc. If you want, you can view the source on my website for the firefox/etc. code but mine is a little more complicated than the one listed above.

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : tables


    Looking for close, open, tables

Searching Video's for close, open, tables
advertisement



How Can I Close And Open Tables



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE