Have Questions? (800) 477-0970

Quick Tip: Alternating Row Colors in Tables


Version 3.x Instructions
Optional: Go to the SurveyGizmo version 2.x instructions

The following tutorial is only necessary if you wish to override the automatic alternating row highlighting that is built-in and based off of the color theme of your survey, chosen under Look & Feel.

simple-table-radio

When displaying tables or matrices with many rows and columns, sometimes it is helpful for the survey taker to be able to easily identify each row within the table or matrix. A simple way to provide the visual aid is to alternate the colors of each row by making every other row have a slight background color, usually gray. Luckily, this can be accomplished with a simple adjustment to the Publish section of your survey.

Making changes to the Theme

  • Go to the Publish tab in the Survey Editor
  • Select the Customize link to the right of your survey screenshot
  • Select the Advanced… tab on the left
  • Choose the Append radio button to display the CSS box
  • You will want to add the following code:
    .sg-even-row td {
    background-color: #CCCCCC !important;
    }

    Note: You can change the #CCCCCC hex code to represent any color (#CCCCCC is a dark gray). You can even replace it with the word ‘red’ (no quotes) if you are not comfortable with hexadecimal color codes.

  • Click Save Changes

alt-row-color-table-radio

Secondary Tip: Continuing the Color Through Row Headers (far left column)

Add the following as an addendum below the above entry:

.sg-even-row th {
background-color: #CCCCCC !important;
}

Version 2.x Instructions

When displaying tables or matrices with many rows and columns, sometimes it is helpful for the survey taker to be able to easily identify each row within the table or matrix. A simple way to provide the visual aid is to alternate the colors of each row by making every other row have a slight background color, usually gray. Luckily, this can be accomplished with a simple adjustment to the Look & Feel section of your survey.

Making changes to Look & Feel

  • Scroll down to the large box titled This Theme’s CSS Template
  • You will find the following code near the bottom:
    table.sg_Table tr.sg_TR { }
  • You will want to add the background-color: #EEEEEE;. The results:
    table.sg_Table tr.sg_TR { background-color: #EEEEEE; }

    Note: You can change the #EEEEEE hex code to represent any color. You can even replace it with the word ‘red’ (no quotes) if you are not comfortable with hexadecimal color codes (alternate site).

  • Click Save Your Customizations

Table with alternating row color

Secondary Tip: Continuing the Color Through Row Headers (far left column)

Add the following as an addendum to the bottom of the CSS Template box:

table.sg_Table tr.sg_TR td.sg_TD1 { background-color: #EEEEEE;}

For Custom Matrices

When you have a custom matrix you must add some extra code. Repeat this, changing the .sg_Group# for each question group in your largest custom matrix. The color code should match the one used in the above changes.

table.sg_Table tr.sg_TR td.sg_Group1 { background-color: #EEEEEE; }
table.sg_Table tr.sg_TR td.sg_Group2 { background-color: #EEEEEE; }

Have you tried SurveyGizmo yet? Try our 14 day free trial

The Survey Expert Blog

By

Why Survey Design Matters for Feedback Surveys

February 3 2012 -

Survey Expert Ryan Farmer observes that many well-known companies aren’t branding their surveys, and discusses why survey design is hyper-important when you want to gather customer feedback.

By

New Team Management & User Permissions System

Starting February 2nd, SurveyGizmo is launching a new set of user management features. Learn more about them here!

By

5 Questions with SurveyGizmo co-founder and CEO Christian Vanek

Boulder’s Daily Camera newspaper interviews Christian Vanek, who shares what’s next for the company.

More from our Survey Experts