1

Having this issue when I view a Survey Response - the question is pushing the column incredibly wide horizontally and then just a very thin column to contain the answers.

Is there a way to have the question column not expand to the length of the question so the person viewing the results doesn't have to scroll horizontally to see the answers in a tiny column?

Thanks

enter image description here

  • any luck re-sizing your columns? – Phil Greer Apr 22 '14 at 17:31
  • Sorry, haven't had a chance to try yet. Will try in next 48 hrs – sayguh Apr 23 '14 at 17:53
1

Yes, you can over-ride SharePoint's column widths for any list. Unfortunately, you can't change this within "List Settings".

There are basically 2 options:

  1. SharePoint Designer
  2. jQuery (my preference)

jQuery method:

  1. Edit your view aspx by adding a Content Editor Web Part
  2. Insert something like the following jQuery into the CEWP and save your changes
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script>
 $(function(){
 $("tr.ms-viewheadertr th:contains('Inventor')", "#MSO_ContentTable").css("width", "50px");
 $("tr.ms-viewheadertr th:contains('Abstract')", "#MSO_ContentTable").css("width", "50px");
 });
</script> 

Replace "Inventor" & "Abstract" with the correct names as per your columns. Also, adjust the "50px" width according to your preferences.

This solution was borrowed from many places, including this blog.

EDIT

In order to adjust the width of your Survey response columns:

A. Upload a text file with the following jQuery to the root of your site collection (e.g. http://yoursite/SiteAssets) :

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script>
 $(function(){
 $("td.ms-formlabel").css("width", "20px");
 $("td.ms-formlabel").css("white-space", "normal");
 });
</script> 

B. In your CEWP on the survey's DispForm.aspx, select "Edit Web Part" and add the URL that points to your new file uploaded in step A to "Content Link".

Note that ms-formlabel represents the "Question" column. You can adjust the width of this to pretty much whatever you desire. The white-space:normal bit will force the text in this column to wrap. You can similarly adjust your "Answer" column by modifying the CSS for ms-formbody.

|improve this answer|||||
  • Can't seem to get this to work... when I add the code to the CEWP it is just rendering on screen as code (not getting picked up as HTML - even if I first paste into notepad to strip any background stuff). Also, this is the standard "View Response" page which has Survey Question on one side and Survey Answer on other side. Do you know what those column names would be? Thanks – sayguh Apr 28 '14 at 17:24
  • @sayguh I updated the original answer with further instructions. Let me know if that works for you! – Phil Greer Apr 28 '14 at 20:23
  • Thanks Phil, I'm away this week and will be trying on Monday – sayguh Apr 29 '14 at 15:14
  • Right on, it should work. Again, ping me if you run into problems. Enjoy your week away! – Phil Greer Apr 29 '14 at 15:19
  • Hey Phil, I'm almost there! I got it to work on a single survey. However, there are many surveys attached to this site. How can I have this apply to all of the surveys in the site? I've tried making edits to default.master and DispForm.aspx in the master files folder but I haven't been able to get it to work. Could you provide some instruction on this? Thanks!! – sayguh May 6 '14 at 14:44
0

A simpler solution to this issue is to simply use a "Return" or "Enter" to force a line break within the question. This will cause the question to wrap.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.