Home

SP Classic Mode: how do I add padding and vertical-align to list web part with CSS

Highlighted
Vanessa Martin
Occasional Contributor

Hi Folks,

A list web parts renders with the text aligned to the middle vertically and with no padding in the columns. What CSS code do I need so that the text is aligned to the top of the cell and there is right padding in each column for some white space? I am in Classic Mode.

I tried the following which didn't work:

<style type="text/css">td#MSOZoneCell_WebPartWPQ1{
vertical-align:top;
padding-right:0.2em;
}
</style>

Help is appreciated. Thanks.

1 Reply

I am pretty sure your selector is incorrect.

 

It should be 

#MSOZoneCell_WebPartWPQ1 td{}

 Try using google chromes developer tools

 - Right click the cell -> inspect 

 

This will let you see styles already applied, so you may have to use !important to override it

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies