Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

How can I center the menu and the gridview control?

Hi, I'm using asp.net 3.5.  The menu is jQuery Superfish.  It uses the attatched css file.  The logo image from the Masterpage file is centered no problem but the Gridview control in the Content page is not centered correctly.  How can I fix this?  thank you.
Survey-Administration-1315897951
MasterPage.master
Default.aspx
superfish.css
0
lapucca
Asked:
lapucca
  • 5
  • 3
  • 2
  • +1
1 Solution
 
Gurvinder Pal SinghCommented:
If there is a live internet link available, please share the same.
0
 
lapuccaAuthor Commented:
I'm doing this on my development pc and it's not ready for deployment.  Are the files that I attached aren't enough?
0
 
dexterrajeshCommented:
hi,

you can include the <center></center> tag for the content area you want to center align,

e.g:

<center>
<div style="text-align:center">        
    <asp:GridView ID="gvAccounts" runat="server" AllowPaging="True" ......
.
.
</center>

similarly for the menu...

hope this helps
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
Gurvinder Pal SinghCommented:
Actually, i have not worked on ASP, so that is why i was asking, since i wont be able to make your files work. I can help with css though
0
 
lapuccaAuthor Commented:
Hi, I tried the <center> tag but now the gridview control shifts to the right instead of the left and still not centered.  I'm also attaching the html code from Firefox view code and see if that would help.  Thank you.
Survey-Administration-1315902169.jpg
Default.aspx
0
 
dexterrajeshCommented:
can you try including the <center> tag in ur master page

like

<center>
<div style="text-align:center">
        <img src="../images/adapt_02.jpg" alt="Adapt"/>    
.
.
.
</center>

undo the changes in default.aspx
0
 
badalpatelCommented:
This might be the issue

<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">        
        </asp:ContentPlaceHolder>
    </div>

Please change this to
 </div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">        
        </asp:ContentPlaceHolder>
   
0
 
lapuccaAuthor Commented:
dex, I tried that and still it's off center, both menu and gridview control

bad, which file is this code that your ref?  The master page or the content page?  Why can't the /div beneath the content placeholder?  Thanks.
0
 
badalpatelCommented:
The problem is in class="sf-menu", it has float:left property which causes the problem
I have change your code and attached it, please check files.
And i have use table to center map, if you dont want this then you can refer http://pmob.co.uk/pob/centred-float.htm to center a floating div


Default2.aspx
MasterPage.master
0
 
lapuccaAuthor Commented:
Hi bad,
I want the menu to be centered as well.  Would this do it/  If not, how can I modify the sf-menu so it would be centered too?  Thank you.
0
 
badalpatelCommented:
yes, please see my attached code, i have centered menu and grid in the sample page.
0
 
lapuccaAuthor Commented:
Thank you.  I guess I have to put it in the table in the maser page for it to be centered.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now