Solved

How can I center the menu and the gridview control?

Posted on 2011-09-13
12
203 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
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 40

Expert Comment

by:gurvinder372
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
 
LVL 40

Expert Comment

by:gurvinder372
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now