Dev Notes

Notes on Development with Microsoft Technologies

Adding Space to the Rating Scale in SharePoint Surveys

25 Comments

A recent client is using surveys that have some very long questions used in a rating scale. This causes the text to be difficult to read because they all get pushed up against one another.

cramped

The offending problem here is a lack of padding between the table cells used to render the survey. Microsoft was nice enough to provide a class that we can override to provide our own spacing, .ms-gridT1. And overriding this is as simple as adding a content editor web part to the newform.aspx page, declaring a style section and overriding the style with something similar to the following:

.ms-gridT1 { padding-top: 10px; padding-bottom: 10px; }

Now you have some nice spacing in questions.

spaced

Advertisements

Author: Chris Quick

I have been a developer of web based solutions since early 2001 delivering solutions to a wide array of organizations using ASP, ASP.NET and SharePoint. I was introduced to SharePoint in 2003 when the consulting firm I worked for at the time introduced it into the workplace. I began working with MOSS 2007 as soon as Microsoft released the RTM version in November 2006. The platform was implemented at the organization I worked for in 2007 and went live in March of that year. I was tasked with the administration and ongoing development of the platform. I currently work as a SharePoint Architect with Artis Consulting, developing solutions for a wide variety of business problems. The goal of this blog is to share my discoveries developing solutions with SharePoint. I welcome your comments and feedback to any post -- and I welcome suggestions for future topics.

25 thoughts on “Adding Space to the Rating Scale in SharePoint Surveys

  1. Pingback: Tweaking the built-in Survey List | Thoughts on SP Here

  2. For the new to HTML coding people here I found out what I need to do by trial and error so I will pass along. In the SharePoint page insert a “Content Editor” WebArt below the survey WebArt. Then, select edit WebArt. When you click in the blank space of the WebArt and then the Insert tab and select “Embed Code.” In this section paste
    .ms-gridT1 {padding-top: 10px; padding-bottom: 10px}

  3. O hope that people are still responding! I cannot access sharepoint designer so I did this instead. It didn’t work so I deleted the webpart. Now the survey questions will not come up. Is there a way to undo this? I cannot seem to find where the code ended up. Does it delete when you delete the webpart?

    Thanks,
    Ashley

  4. Thank you for the great solution!
    to help People here is what you have to copy into your CEWP:

    .ms-gridT1 {
    PADDING-BOTTOM: 10px; PADDING-TOP: 10px
    }

  5. Pingback: Zebra-Striping SharePoint 2013 Rating Scales in Surveys – No JavaScript required! | Jacob

  6. Hi,
    I have added spaces by following the above procedure.
    But I have a page separator for each question.
    The css is applied to only first page while the other pages are displayed in default style.

    How should I apply the css to other pages too?

    Regards,
    Soni

  7. Is there a way to reference videos in the survey? I’ve referenced images, but videos isn’t showing.

  8. Unable to access the HTML source of a CEWP on NewForm.aspx pages because the editing tool bar is not displayed (SP2010). Other aspx pages don´t have that issue. Anybody knows how to overcome that?

    • Use SPD. Locate the NewForm.aspx, EditForm.aspx, DispForm.apsx pages. Edit each in Advanced mode (right mouse click on filename). Find the existing … markup and add the .ms-gridT1 style as it appears above, immediately after the last } chr.
      Immediately Save (ie without refreshing the Designer pane (this can crash SPD)).
      🙂

  9. I added a space and a bunch of underscores after each questions. It’s not perfect but it’s an easy fix.

  10. CRose: Copy and paste the following into your Source Editor… Box:

    .ms-gridT1 {padding-top: 10px; padding-bottom: 10px}

  11. Hello; thank you for the css reference however this can be done with a simpler method. You do not need a CEWP (Content Editor Web Part).. Simply put your style tags after this:

    /* Your CSS work */

    • oops looks like the tags got stripped.. Basically look for the PlaceHolderMain content tag and you can place your CSS inside that tag.. This does presume you understand how to use Sharepoint Designer.. – regards

  12. Pingback: Customize survey form in SharePoint 2010 « June's Time

  13. the easiest way to do it is to add 20 underscores _ right after the end of each statement

  14. Hi – I am not sure how to add “style” section to my share point page to add the code that you have provided above. i am trying to add line spaces in my rating scale question but none of the codes are working for me. i am adding a content editor web part and in source editor i tried to add your code.. please help!

    • After you add the content editor web part to the page, edit the content and then look for the HTML button in the ribbon. When it opens, click on edit source and then add in <style type="text/css&quote;>.my-style{...}<style> Save the page and you should see the changes reflected.

      • Chris – I am also having the problem where when the content editor is edited to have .ms-gridT1 { padding-top: 10px; padding-bottom: 10px; } as the content in the HTML Source, nothing happens. Nothing changes for the surveys on the page. I even changed the px to something ridiculous like 50px, still nothing. When I view the source code on the survey itself, I am unable to find the code that was added using the content editor. Am I missing something? Thanks!

  15. Is there a way to add more ratings text? SharePoint only gives you the option to add three boxes of text. I would like 5.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s