Thursday, February 16, 2012

Adding White Space to SharePoint Survery Rating (Likert) Scale

I get this question a LOT! The fix is quick and easy and doesn't even require access to SharePoint Designer (Though IMHO, it's easier and faster)

The thing is, SharePoint survey rating scales use the class 'ms-gridT1.' All you have to do is append a little CSS to the class and you're done!

How?
1. Add a Content Editor Web Part to the page.
2. Click 'Modify Shared Web Part' and choose 'Source Editor'
3. Add the following code...
<script type="text/javascript" type="text/javascript">
// This script can be used to add white space to a ratings scale on a survey form
// Place this script inside a Content Editor Web Part in Source Mode.
// © Copyright Chris Gannon 2012 chris@chrisgannon.com
// Feel free to distribute this around. But props and credit are appreciated!
$('TH.ms-gridT1').css({'padding-bottom':'5px'});
</script>

4. Under 'Layout' check the 'Hidden' box to hide the CEWP.

Have a look at the before-model...
Now, have a look at the after...

Better, huh?

I hope this helps!

CG

1 comment:

Maltadvocate said...

Looks very promising Chris. However, how do you insert a webpart into the newform.aspx page. I don't see an option to edit this page.

Thanks, Tim