By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,948 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,948 IT Pros & Developers. It's quick & easy.

How to hide/show a row ina table

P: 23
Hi,

I have 5 rows in a html table.I want to hide the 4th one.How to achieve this.?

Please help me.

Regards,
Nussu
Nov 27 '07 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 390
do something like this
give one id to the specified row.
then set the style of that row

code sample
Expand|Select|Wrap|Line Numbers
  1. function HideRow(){    var row = document.getElementById("row4");    if (row.style.display == '')  row.style.display = 'none';    else row.style.display = '';}
  2.  
[HTML] <tr id="row4"></tr>

<p><button onclick="HideRow()" >Hide</button></p>[/HTML]
Nov 27 '07 #2

P: 23
Hi mishra,

Thanks a lot , but the row need to be hide once it get loaded.I mean once the page loaded the row in a table need not be displayed
Nov 27 '07 #3

Expert 100+
P: 390
call the function on body onload method and see
Nov 27 '07 #4

P: 23
Mishra ,

Its working fine now .Thanks a lot.

Regards,
Nussu
Nov 27 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.