Solved

Hiding an HTML table row in run-time

Posted on 2004-10-17
7
615 Views
Last Modified: 2008-02-26
Experts, I have the usual HTML table, and I want to hide/re-display some of its <tr> in the run-time. How do I do this?

Of course I'm asking how to do this in ASP.Net

Thanks for your time,

James
0
Comment
Question by:James_fl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 20

Assisted Solution

by:ihenry
ihenry earned 100 total points
ID: 12333442
Add attribute runat="server" to each of TR tag you want to hide/display programmatically and in code behind just set its visible property to false/true

<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1">
      <TR runat="server" id="row1">
            <TD></TD>
            <TD></TD>
            <TD></TD>
      </TR>
      <TR runat="server" id="row2">
            <TD></TD>
            <TD></TD>
            <TD></TD>
      </TR>
      <TR>
            <TD></TD>
            <TD></TD>
            <TD></TD>
      </TR>
</TABLE>
'---
row1.Visible = False
row2.Visible = True
0
 
LVL 18

Accepted Solution

by:
tusharashah earned 400 total points
ID: 12333454
Right click your Table & make it RunAsServer Control..

then you can simply access any row of that table in code behind liek

Table1.Rows[1].Visible = false;

-tushar
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12334060
You did not state on what condition or on what user action you want the row display state to toggle.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:James_fl
ID: 12335659
Points given. However, tusharashah gets most points since I tried the first solution and it didn't work unless I have the table as a server control.
0
 

Author Comment

by:James_fl
ID: 12335661
Thanks btw
0
 
LVL 20

Expert Comment

by:ihenry
ID: 12336146
Hi James

You wanted to toggle display state of some tr[s] but not all, that's why I offered you my suggestion. And I'm very sure it can work very well with your requirement. The only mistake, I guess, I didn't mention explicitly that you need to declare the two variable row1 and row2 in your class. Anyway, tushar is worth more points since you can get his solution working :o)

Cheers!
0
 

Author Comment

by:James_fl
ID: 12336224
cheers ihenry, i'll try doing that. Thank you for your help :D
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question