3

I'm not an expert in web layout, but I know that defining the number of pixels for the height and width for any web component can cause problems, since users screen have different resolutions. And it is better to provide percentage for the height and width. Currently inside my SharePoint 2013 team site,

I have added some App Web and when I select (Edit Web Part --- Appearance – Height – Width), I was not able to define percentage of the Height and width , and I was only able to define number pixels, cm, inches, etc , which might behave differently based of the users screen resolutions?

So is there a way to define relative height and width?

1 Answer 1

1

From what I understand , webparts reside inside a webpart zone. Webpart zones are nothing but simple SharePoint based markup declarations inside a page layout. The important thing is to understand that the structure of the page layout decides the relative sizes of the webpart.

So lets say there is a page created using a blank webpart page layout. The page layout contains a table with 100% width. A webpart zone is declared inside the table.

When a webpart is added to the webpart zone, unless you explicitly modified the height and width settings through edit webpart properties, it is going to stay relative to the size of the table (webpartzone container) to be precise.Therefore pickup a 100% in width. So, its the markup of the page layout that decides what size your webpart pickups unless modified.

Custom webparts created through code where you have control over the ascx (that holds the markup) for your code, can be modified during development time for height and width in both percent and pixel. This webpart can override the height and width of the table or div containing the webpart zone in the page layout.

2
  • One thing to add to Arko's answer is that if you're using app parts, they don't play nice and auto-adjust their sizes.
    – Josey
    Commented Aug 29, 2013 at 15:06
  • yes i am adding App parts .
    – John John
    Commented Aug 29, 2013 at 15:22

Your Answer

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

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