Adding Space to the Rating Scale in SharePoint Surveys

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

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

  1. 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}

  2. 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

  3. 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

  4. 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?

    1. 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)).
      🙂

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

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

  6. 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 */

    1. 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

  7. 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!

    1. 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.

      1. 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!

  8. 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.

    1. Peter, I do not believe there is a way to do this with just the ratings question. You would most likely have to extend SharePoint with a new custom field type.

      1. How would you do that? Unlike other lists, SharePoint doesn’t provide an option to add a column.

      2. Actually, when you add a question, you are actually adding a new column to the list. In code, a survey is nothing more than a special list.

        I have not personally done any development to create new site column types. You can search the web and find examples. I attempted to create one in SharePoint 2007 for an employer, but the project was abandoned before I completed my research, so I know it can be done. I just haven’t had a need to explore it for any of my current clients.

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