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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Hide data rows on startup of the page
Old 11-06-2010, 06:09 AM Hide data rows on startup of the page
Junior Talker

Posts: 1
Name: whiteshadow
Trades: 0
Boas

Eu tenho este código
Code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title>

&lt;script type="text/javascript">

function poorman_toggle(id)
{
var tr = document.getElementById(id);
if (tr==null) { return; }
var bExpand = tr.style.display == '';
tr.style.display = (bExpand ? 'none' : '');
}
</script>

</head>
<body>

<div>
<table border="1">
<tr id="trGrpHeader1">
<td width="100"><span onclick="java script:poorman_toggle('Row1');">Row 1</span></td>
<td width="100"><span onclick="java script:poorman_toggle('Row2');">Row 2</span></td> 
<td width="100"><span onclick="java script:poorman_toggle('Row3');">Row 3</span></td> 
</tr>
<tr id="Row1">
<td width="100">  Row1 - Data</td>
<td width="100" class="number">1</td>
<td width="100" class="number">4</td>
</tr>
<tr id="Row2">
<td>  Row 2 - Data</td>
<td class="number">2</td>
<td class="number">5</td>
</tr>
<tr id="Row3">
<td>  Row 3 - data</td>
<td class="number">3</td>
<td class="number">6</td>
</tr>
</table>
</div>
</body>
</html>

Question:

How could i hide data rows on the startup of the page (when i load the page), and show only the headder?

Marco
marcobranco1975 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-06-2010, 11:22 AM Re: Hide data rows on startup of the page
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
With javascript, and then a nice jQuery rolldown ?
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 11-06-2010, 12:21 PM Re: Hide data rows on startup of the page
Mug
Skilled Talker

Posts: 78
Trades: 0
I like using jQuery for this sort of thing. There are probably more streamlined ways of doing this but there is a brief tutorial at:

http://api.jquery.com/hide/

hope that helps.
__________________
Mug

Please login or register to view this content. Registration is FREE
Mug is offline
Reply With Quote
View Public Profile
 
Old 11-08-2010, 03:56 AM Re: Hide data rows on startup of the page
Junior Talker

Posts: 3
Name: Khunponpun
Trades: 0
I think you can use CSS. (display : none)

hope this helps.

Thanks
__________________
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
jonmufc is offline
Reply With Quote
View Public Profile Visit jonmufc's homepage!
 
Old 11-08-2010, 08:29 PM Re: Hide data rows on startup of the page
sean1984's Avatar
Novice Talker

Posts: 9
Name: sean chow
Location: china
Trades: 0
HTML Code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title>
<script type="text/javascript">
function poorman_toggle(id)
{
var tr = document.getElementById(id);
if (tr==null) { return; }
var bExpand = tr.style.display == '';
tr.style.display = (bExpand ? 'none' : '');
}
</script>
</head>
<body>
<div>
<table border="1">
<tr id="trGrpHeader1">
<td width="100"><span onClick="javascript:poorman_toggle('Row1');">Row 1</span></td>
<td width="100"><span onClick="javascript:poorman_toggle('Row2');">Row 2</span></td> 
<td width="100"><span onClick="javascript:poorman_toggle('Row3');">Row 3</span></td> 
</tr>
<tr id="Row1" style="display:none;">
<td width="100">  Row1 - Data</td>
<td width="100" class="number">1</td>
<td width="100" class="number">4</td>
</tr>
<tr id="Row2"  style="display:none;">
<td>  Row 2 - Data</td>
<td class="number">2</td>
<td class="number">5</td>
</tr>
<tr id="Row3"  style="display:none;">
<td>  Row 3 - data</td>
<td class="number">3</td>
<td class="number">6</td>
</tr>
</table>
</div>
</body>
</html>

OR

HTML Code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"  language="javascript"></script>
<script>
$(document).ready(function(){
  $('#Row1,#Row2,#Row3').hide();
});
</script>
</head>
<body>
<div>
<table border="1">
<tr id="trGrpHeader1">
<td width="100"><span onClick="$('#Row1').show();">Row 1</span></td>
<td width="100"><span onClick="$('#Row2').show();">Row 2</span></td> 
<td width="100"><span onClick="$('#Row3').show();">Row 3</span></td> 
</tr>
<tr id="Row1" >
<td width="100">  Row1 - Data</td>
<td width="100" class="number">1</td>
<td width="100" class="number">4</td>
</tr>
<tr id="Row2" >
<td>  Row 2 - Data</td>
<td class="number">2</td>
<td class="number">5</td>
</tr>
<tr id="Row3" >
<td>  Row 3 - data</td>
<td class="number">3</td>
<td class="number">6</td>
</tr>
</table>
</div>
</body>
</html>
sean1984 is offline
Reply With Quote
View Public Profile
 
Old 11-10-2010, 02:34 AM Re: Hide data rows on startup of the page
Banned

Posts: 143
Name: maheshadodis
Location: USA
Trades: 0
Quote:
Originally Posted by marcobranco1975 View Post
Boas

Eu tenho este código
Code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title>

&lt;script type="text/javascript">

function poorman_toggle(id)
{
var tr = document.getElementById(id);
if (tr==null) { return; }
var bExpand = tr.style.display == '';
tr.style.display = (bExpand ? 'none' : '');
}
</script>

</head>
<body>

<div>
<table border="1">
<tr id="trGrpHeader1">
<td width="100"><span onclick="java script:poorman_toggle('Row1');">Row 1</span></td>
<td width="100"><span onclick="java script:poorman_toggle('Row2');">Row 2</span></td> 
<td width="100"><span onclick="java script:poorman_toggle('Row3');">Row 3</span></td> 
</tr>
<tr id="Row1">
<td width="100">  Row1 - Data</td>
<td width="100" class="number">1</td>
<td width="100" class="number">4</td>
</tr>
<tr id="Row2">
<td>  Row 2 - Data</td>
<td class="number">2</td>
<td class="number">5</td>
</tr>
<tr id="Row3">
<td>  Row 3 - data</td>
<td class="number">3</td>
<td class="number">6</td>
</tr>
</table>
</div>
</body>
</html>

Question:

How could i hide data rows on the startup of the page (when i load the page), and show only the headder?

Marco
Hi,
you can use timer on onload() event you can set the timer after loading the page timer starts and then when timer finish its execution load ur table this what can do if u want ur table to automatically load after page load if u want to load table manually u can write function for on click event to load table
maheshadodis is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Hide data rows on startup of the page
 

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 0.49310 seconds with 12 queries