Link to home
Start Free TrialLog in
Avatar of JustAskMe
JustAskMe

asked on

hide half of a html table using code behind

Ok this is a html table with a few links, I want to make invisible or better disabled a few of the links using c# code behind.

I tried to split the links in two tables so I could hide the half that I want, the problem is that it wont look normal... It must still be on one line and I wasn't able to accomplish that...  

any help?
<div align="center">
	<center>
		<table id="AutoNumber2" style="BORDER-COLLAPSE: collapse" borderColor="#111111" cellSpacing="0"
			cellPadding="0" width="775" border="0">
			<tr>
				<td width="7" background="admin_images/white_bg.gif" height="19"></td>
				<td width="6"><IMG height=19 src="admin_images/<%=hleft%>" width=6 border=0 ></td>
				<td width=49 background="admin_images/<%=hbg%>" height=19 
    >
					<font style="FONT-SIZE: 8pt" face="Arial"><A class="headerlinks" href="Index.aspx?id=home">Home</font></A>
					
				</td>
				<td width="2"><IMG height=19 src="admin_images/<%=hright%>" width=2 border=0 ></td>
				<td width="6"><IMG height=19 src="admin_images/<%=hleft1%>" width=6 border=0 ></td>
				<td width=100 background="admin_images/<%=hbg1%>" height=19 
    >
					<font style="FONT-SIZE: 8pt" face="Arial"><A class="headerlinks" href="Index.aspx?id=searchorders">Order 
							Manager</font></A>
					
				</td>
				<td width="2"><IMG height=19 src="admin_images/<%=hright1%>" width=2 border=0 ></td>
				<td width="6"><IMG height=19 src="admin_images/<%=hleft2%>" width=6 border=0 ></td>
				<td width=100 background="admin_images/<%=hbg2%>" height=19 
    >
					<font style="FONT-SIZE: 8pt" face="Arial"><A class="headerlinks" href="Index.aspx?id=custmanage">Customer 
							Manager</font></A>
					
				</td>
				<td width="2"><IMG height=19 src="admin_images/<%=hright2%>" width=2 border=0 ></td>
				<td width="6"><IMG height=19 src="admin_images/<%=hleft3%>" width=6 border=0 ></td>
				<td width=85 background="admin_images/<%=hbg3%>" height=19 
    >
					<font style="FONT-SIZE: 8pt" face="Arial"><A class="headerlinks" href="Index.aspx?id=shippingconfiguration">Configuration</font></A>
					
				</td>
				<td width="2"><IMG height=19 src="admin_images/<%=hright3%>" width=2 border=0 ></td>
				<td width="6"><IMG height=19 src="admin_images/<%=hleft4%>" width=6 border=0 ></td>
				<td width=100 background="admin_images/<%=hbg4%>" height=19 
    >
					<font style="FONT-SIZE: 8pt" face="Arial"><A class="headerlinks" href="Index.aspx?id=inventorymanager">Inventory 
							Manager</font></A>
					
				</td>
				<td width="2"><IMG height=19 src="admin_images/<%=hright4%>" width=2 border=0 ></td>
				<td width="6"><IMG height=19 src="admin_images/<%=hleft5%>" width=6 border=0 ></td>
				<td width=115 background="admin_images/<%=hbg5%>" height=19 
    >
					<font style="FONT-SIZE: 8pt" face="Arial"><A class="headerlinks" href="Index.aspx?id=homepagewelcome">Content 
							Management</font></A>
					
				</td>
				<td width="2"><IMG height=19 src="admin_images/<%=hright5%>" width=2 border=0 ></td>
				<td width="6"><IMG height=19 src="admin_images/<%=hleft6%>" width=6 border=0 ></td>
				<td width=115 background="admin_images/<%=hbg6%>" height=19 
    >
					<font style="FONT-SIZE: 8pt" face="Arial"><A class="headerlinks" href="Index.aspx?id=adminedit">Store 
							Administration</font></A>
					
				</td>
				<td width="2"><IMG height=19 src="admin_images/<%=hright6%>" width=2 border=0 ></td>
				<td width="6"><IMG height=19 src="admin_images/<%=hleft7%>" width=6 border=0 ></td>
				<td width=52 background="admin_images/<%=hbg7%>" height=19 
    >
					<font style="FONT-SIZE: 8pt" face="Arial"><A class="headerlinks" href="Index.aspx?id=adminreportoptions">Reports</font></A>
									</td>
				<td width="2"><IMG height=19 src="admin_images/<%=hright7%>" width=2 border=0 ></td>
			</tr>
		</table>
	</center>
</div>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of EugeneLT
EugeneLT

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you want to make links disabled, use **onclick="return false"** in the anchor tag. e.g.
<A class="headerlinks" onclick="return false" href="Index.aspx?id=searchorders">

If you want to remove underline also, use **style="text-decoration:none"**
<A class="headerlinks" style="text-decoration:none" onclick="return false" href="Index.aspx?id=searchorders">

if you want to completely hide the links, use **style="display:none"**
<A class="headerlinks" style="display:none" href="Index.aspx?id=searchorders">

=====================
if you put the following code in your html:
<style type="text/css">
    a.hide {
        display: none;
    }
    a.dis {
        text-decoration: none;
    }
</style>

then styles could be used by applying multiple classes (separated by space) in "class" attribute. e.g
<A class="headerlinks hide" href="Index.aspx?id=searchorders">
or
<A class="headerlinks dis" onclick="return false" href="Index.aspx?id=searchorders">
Avatar of JustAskMe
JustAskMe

ASKER

EugeneLT: thanks! that makes sense.

Can you give me a sample of the syntax, i could use to make this change?

Thank you  
thanks I figured it out