Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

in my custom master page the content doesn't fit into the page since a automatically generated table with the id=layoutsTable has width="100%". Since i have a fixed page layout there are some issues in the correct display.

Unfortunately this table is created automatically from the Control with id="PlaceHolderMain". I can't change this behaviour from the master-Layout neither in the .css-Page.

The parent div-container has the correct width but the table has this behaviour set instyle..

How can i change this instyle-Code or

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Try the following CSS:

#layoutsTable
{
    width: inherit !important;
}

The !important flag usually works for me to even overwrite inline CSS styles.

share|improve this answer
add comment

You can use the class s4-nosetwidth to prevent SharePoint from taking over and injecting a variable width on the page. The best spot to do this is in the workspace div, but you can do it in other ones as well.

For example, you could just change this:

<div ID="s4-workspace">

To:

<div ID="s4-workspace" class="s4-nosetwidth">

Update:

Since the above solution is not applying directly to the generated table, you could always do this through javascript by adding this to your page:

<script type="text/javascript">
  _spBodyOnLoadFunctionNames.push('setLayoutsTableWidth');

  function setLayoutsTableWidth() {
    var layoutsTable = document.getElementById('layoutsTable');
    layoutsTable.style.width = '200px';
  }
</script>
share|improve this answer
    
i did this already.. but since the width is set instyle on this particular table the rule from the nosetwidth class is outruled.. –  Peter Mar 5 '12 at 14:10
    
@Peter Sorry, I misunderstood. I've added a potential solution using javascript since you know the table's ID. –  theChrisKent Mar 5 '12 at 14:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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