Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 03-16-2009, 04:50 PM div's and table help
Skilled Talker

Posts: 64
Name: Ralph Freshour
Trades: 0
I have a 4 row table within a div. I'm trying to "roll up" the table so that only the first row is displayed when I click on a JS link. My JS event sets the div style.height to 170px which is about one row high. But the problem is that the table still shows 4 rows. So, I'm wondering if tables can be used within a div?

I have used this method successfully to resize a div section but it did not contain a table.

Thanks for any help...
__________________
RalphF
Business Text Messaging Services

Please login or register to view this content. Registration is FREE

Last edited by rfresh; 03-16-2009 at 04:52 PM..
rfresh is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-16-2009, 04:55 PM Re: div's and table help
Extreme Talker

Posts: 189
Trades: 0
you could set the height to 1ex (height of X) and/or put overflow:hidden in the css
simster is offline
Reply With Quote
View Public Profile
 
Old 03-16-2009, 06:03 PM Re: div's and table help
Skilled Talker

Posts: 64
Name: Ralph Freshour
Trades: 0
That did work but part of the top of the table is still visible.

I tried setting 1ex to 0ex but 0ex didn't hide the table at all. 1px hides almost all of the table but 0px doesn't hide any of it either.

PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<
HTML>
<
HEAD>
<
script type="text/javascript">
<!-- 
Hide javascript code
function expand_collapse_section()
{
  
document.getElementById("id_expand_collapse_section_container").style.height "1ex";
  return;
}
// stop hiding javascript -->
</script>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<FORM>
<A HREF="javascript:expand_collapse_section()">collapse</A>
<div id="id_expand_collapse_section_container" style="overflow: hidden;">
<TABLE border=1>
<TR>
<TD>
aaaa
</TD>
</TR>
<TR>
<TD>
bbbb
</TD>
</TR>
</TABLE>
</div>
</HTML> 
__________________
RalphF
Business Text Messaging Services

Please login or register to view this content. Registration is FREE
rfresh is offline
Reply With Quote
View Public Profile
 
Old 03-16-2009, 08:39 PM Re: div's and table help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Give the rows you want to hide an ID, then set a classname on those rows with a display:none rule when you want to hide them. The div will then collapse at the same time.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to div's and table help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.28987 seconds with 12 queries