Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I center the menu and the gridview control?

Posted on 2011-09-13
12
Medium Priority
?
211 Views
Last Modified: 2012-05-12
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
Comment
Question by:lapucca
[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
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 36527757
If there is a live internet link available, please share the same.
0
 

Author Comment

by:lapucca
ID: 36527801
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
 
LVL 9

Expert Comment

by:dexterrajesh
ID: 36527835
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 36527837
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
 

Author Comment

by:lapucca
ID: 36528065
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
 
LVL 9

Expert Comment

by:dexterrajesh
ID: 36528133
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
 
LVL 6

Expert Comment

by:badalpatel
ID: 36529146
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
 

Author Comment

by:lapucca
ID: 36532035
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
 
LVL 6

Accepted Solution

by:
badalpatel earned 2000 total points
ID: 36534508
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
 

Author Comment

by:lapucca
ID: 36547269
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
 
LVL 6

Expert Comment

by:badalpatel
ID: 36547559
yes, please see my attached code, i have centered menu and grid in the sample page.
0
 

Author Closing Comment

by:lapucca
ID: 36558423
Thank you.  I guess I have to put it in the table in the maser page for it to be centered.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
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 Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

721 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