Click here to Skip to main content
15,907,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi/Hello!
How to increase the width and height of menu items and also add some background and styles etc.Here is screen shot LINK
I want that database,tables,Add which options on the left side all are fit in the table cell,I tried again and again google it but I can't find the solution so i post here.. I know code project have every problem solution.

What I have tried:

Here is my code please help me how to resolve this issue
ASP.NET
<table style="width: 100%">
<tr>
<td class="h50" style="height: 64px; font-size:large; color:Black">
<asp:Label ID="Label1" runat="server" Text="Home"></asp:Label>
</td>
</tr>
<tr>
<td style="height: 100px">
<table style="width: 100%; height: 166px">
<tr>
<td class="col_w450" style="width: 79px; background-color: #99CCFF;">
<asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6" 
 DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em" 
 ForeColor="#990000" onmenuitemclick="Menu1_MenuItemClick" 
 StaticSubMenuIndent="10px">
<DynamicHoverStyle BackColor="#990000" ForeColor="White" /> <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="#FFFBD6" />
<DynamicSelectedStyle BackColor="#FFCC66" />
 <Items>
 <asp:MenuItem Text="Database" Value="Database">
 <asp:MenuItem Text="Create datbase" Value="Create datbase"></asp:MenuItem>
 <asp:MenuItem Text="Update database" Value="Update database"></asp:MenuItem>
<asp:MenuItem Text="Delete database" Value="Delete database"></asp:MenuItem>
<asp:MenuItem Text="Tables" Value="Tables"></asp:MenuItem>
</asp:MenuItem>
</Items>
<StaticHoverStyle BackColor="#990000" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticSelectedStyle BackColor="#FFCC66" />
</asp:Menu>
</td>
<td rowspan="4" style="background-color: #FFFFCC">
 </td>
</tr><tr>
Posted
Updated 20-Mar-16 22:16pm
Comments
ZurdoDev 19-Mar-16 22:36pm    
What are you having problems with specifically? You'll need to add CSS to do this.
Hameed Khan 20-Mar-16 2:36am    
How??

1 solution

Create CSS file and link it in the head of your page.
Remove all inline styling of your table and add class="my-table" (name it whatever you like). If you know this particular style will be for this one, single table (as opposed to more then one table, add id="my-table" instead.

To your asp:Menu add CssClass my-menu

Your CSS:
CSS
.my-table, /* this describes class my-table*/
#my-table /* this describes the table with id my-class*/
{
width: 100%;
height: 166px;
}

.col_w450 /* this is your menu container*/
{
width: 79px; background-color: #99CCFF;
}

/* here you add whatever properties you need on your menu*/
.my-menu { 
width: 150px;
height:24px;
line-height: 2em;
background-color: #FFFBD6;
}

If you're doing web development, learn CSS. There is fairly basic tutorial at w3schools.com which should get you started.

If this helps, please accept the solution. Thank you and good luck.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900