enter image description here

We have deployed a new master page to 2010 and our developer has left the position. Now management has given me a chance to learn development.

We had a Issue When I try to decrease the width and Size of top global navigation. The master Page is showing in veered view as shown in Fig. What to do to keep master-page Constant and increase auto?

  • Can you show some code?
    – wjervis
    May 12, 2014 at 17:17
  • What code do you need to show!! May 12, 2014 at 17:37
  • The code you used to change the size of the navigation.
    – wjervis
    May 12, 2014 at 17:44
  • I have change the code to this.GlobalNavMenu div ul > li.static { background: linear-gradient(to bottom, #3E64AA 0%, #193966 100%) repeat scroll 0 0 rgba(0, 0, 0, 0); border: 2px solid #193966; border-top-left-radius: 10px; border-top-right-radius: 10px; margin-right: 3px; padding: 6px 12px; width: auto; } May 12, 2014 at 17:50
  • I saw your other question regarding creating a wsp branding package. I'm going to assume that you did this in Visual Studio then. Unfortunately, my HTML/CSS is rather horrible to begin with, and I don't have experience creating master pages with Visual Studio. Try including that code in your answer, with formatting. It'll help those with the experience/knowledge.
    – wjervis
    May 12, 2014 at 17:54

1 Answer 1


The problem is that you have too many columns in a view, which expands beyond the original width of the body. This is common among OOTB lists where multiple columns are within a view. There are many possible fixes to this problem.

  • Set a min-width of 's4-bodyContainer' to a higher value
  • Run a jQuery/JS script to make adjustments to the width when SP is done rendering the table.

Using the above mentioned second approach, you could do something like:

$(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(fixWidth, "sp.js");

$(window).resize(function () {

function fixWidth(){
    //Elements with the potential to be too wide.
    //Make adjustments to below line based on your structure.
    elements = $(".ms-bodyareacell > div > table, .main-container > div > table, #layoutsTable");
    //#layoutsTable for Wiki Pages

    leftPanelWidth = $("#s4-leftpanel").width();
    //For each Elements
        //if it’s wider than the side width
        window.console && console.log('Width: ' + $(this).width());
        if($(this).width() > ($("#s4-bodyContainer").width() - leftPanelWidth ))
            //Calculate the new width taking the left nav into account
            newWidth = leftPanelWidth + $(this).width();
            //Set the width!
            $("#s4-bodyContainer > div").attr("style","width:" + newWidth +"px");
  • Nice answer. Should also mention the easiest fix is to just to remove a column or two from the view. Many of the OOTB columns are always blank, anyway.
    – Omegacron
    May 12, 2014 at 20:57
  • Its not a list ...When I try to upload the masterpage and page layouts I am seeing that Error ....Sorry to Ask I am new to development!!where do in need to Set a min-width of s4-dodyContainer and how run the jquery /jsscript and where Plse Plse help me out in this May 12, 2014 at 21:44
  • You'd need to edit the CSS and/or JavaScript file referenced from your master page. Look up for how to apply custom master page in SharePoint. Again, there are many ways to include your JS and CSS file.
    – Aveenav
    May 12, 2014 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.