Zebra-striping SharePoint Questions in SharePoint Survey
Achieving zebra striping in survey questions (helping users to distinguish between questions) is very easy with JQuery…
….you can add the following in the PlaceHolderAdditionalPageHead section in SharePoint Designer for NewForm.aspx and EditForm.aspx (simply copy the script and style sections below):
<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server"> <style type="text/css"> .oddrow { background : #eee9e9 !important;} </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('td.ms-formbodysurvey table tbody tr:odd').addClass("oddrow"); }); </script> <SharePoint:UIVersionedContent UIVersion="4" runat="server"><ContentTemplate> <SharePoint:CssRegistration Name="forms.css" runat="server"/> </ContentTemplate></SharePoint:UIVersionedContent> </asp:Content>
Advertisements
could be improved by using this to only select the tables with attribute summary=”rating..”
$(‘table[summary]>tbody>tr:odd’).addClass(“oddrow”);
mark mcadam
March 27, 2012 at 1:01 am
[…] https://sacarter.wordpress.com/2011/07/01/zebra-striping-sharepoint-questions-in-sharepoint-survey/ […]
Customize survey form in SharePoint 2010 « June's Time
July 12, 2012 at 11:09 pm
well done !!!! u just made my day 🙂
Haider
October 8, 2012 at 11:57 am