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
Solved

How can I center the menu and the gridview control?

Posted on 2011-09-13
12
206 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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…
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…

839 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