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

Copper 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