Skip to content

The Chris Kent

Quick Fixes, Workarounds, and Other Neat Tricks

  • Home
  • About
  • Speaking
HomePosts tagged 'Left Panel'

Left Panel

Changing the Width of the Left Panel

May 11, 2012May 9, 2012 theChrisKent Branding, List/Library Settings, SharePoint CSS, Left Panel, Master Page, MetaData Navigation, MSO_ContentTable, s4-leftpanel, SharePoint, Tree
Applies To: SharePoint 2010

We’ve been using the MetaData Navigation on a site with custom branding and everything’s been working great. Recently, they decided to remove the Key Filters. This was simple enough using the List Settings but I quickly found that the width of the Left Panel automatically cut off my taxonomy item names without the Key Filters there to stretch it.

Users can easily grab the little bar and grow this part of the left panel’s treeview, but why should they have too for initial viewing? Some quick digging in the rendered HTML showed that the Left Panel’s width was set to 155 px by default. All I wanted was to change that to 200 px.

So, I opened my custom master page (based on v4.master) and went to the div with id=”s4-leftpanel” and found that the style was not set there and was being set in code somewhere. No worries, if you do set it here, it won’t be overridden by whatever part of the code assigns these values. So to adjust your default width just add a style attribute to your s4-leftpanel div:

<div id="s4-leftpanel" style="width:200px;">

If you save this and check it on a live site you’ll find things don’t look right. The key is to also adjust the  MSO_ContentTable div to have a matching left margin:

<div id="MSO_ContentTable" style="margin-left:200px;">

Voila! That’s it! The width can still be adjusted by the end user using the grab bar, but the default is set and you are happy.

Rate this:

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • Tumblr
  • Pinterest
  • Reddit
  • LinkedIn

Like this:

Like Loading...
3 Comments

Office Development

Recent Posts

  • Thank you Microsoft 365 Conference!
  • Getting the Binary Value of an ASCII Character in Power Apps
  • Converting Integers to Binary in Power Apps
  • Converting Binary to Integers in Power Apps
  • Thank you M365 Collaboration Conference!

Popular Posts

  • Applying Column Formats to Multi-line Text Fields
  • Custom Icon Buttons in Power Apps with Hover Color
  • Generate List Formatting Elements in a Loop Using forEach
  • Formatting Values Using "Contains" in List Formatting
  • Validate Email Address Columns in SharePoint

Archives

  • December 2022
  • May 2022
  • April 2022
  • May 2021
  • June 2020
  • April 2020
  • November 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • August 2018
  • July 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • August 2015
  • April 2015
  • February 2015
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • August 2013
  • March 2013
  • February 2013
  • January 2013
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
Create a website or blog at WordPress.com
  • LinkedIn
  • Twitter
  • Follow Following
    • The Chris Kent
    • Join 367 other followers
    • Already have a WordPress.com account? Log in now.
    • The Chris Kent
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
%d bloggers like this: