Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How can I center the menu and the gridview control?

Posted on 2011-09-13
12
Medium Priority
?
213 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: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
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!

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
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…
Suggested Courses

963 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