Need help with table to have striped background style

  • Solartime_MAG
    Asked on 7 września 2023 08:57

    Dzień dobry czy jest możliwość zmiany kolorystyki tabeli co drugi wiersz?

    Stan obecny:

    Need help with table to have striped background style Image 1 Screenshot 30

    Efekt który chciałabym uzyskać:

    Need help with table to have striped background style Image 2 Screenshot 41

  • Jovanne Jotform Support
    Replied on 7 września 2023 17:29

    Hi Solartime_MAG,

    Thanks for reaching out to Jotform Support. Unfortunately, our Polish Support agents are busy helping other Jotform users at the moment. I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in Polish, let us know and we can have them do that. But, keep in mind that you'd have to wait until they're available again.

    Now, let me help you with your question. You can try adding this CSS to have alternating colors for your rows:

    /*Add alternating color for rows - 5512729 */
    .form-matrix-table tr:nth-child(odd) td {
    background-color: blue !important;
    }

    .form-matrix-table tr:nth-child(even) td {
    background-color: lightblue !important;
    }
    .form-matrix-column-headers {
      background : blue !important;
      color : white !important;
    }
    .form-matrix-row-headers {
      background : blue !important;
      color : white !important;
    }
    /*ends here*/

    Adding this CSS code is easy. Let me show you how:

    1. In the Form Builder, open the Form Designer by selecting the paint roller icon in the upper-right corner.
    2. In the Form Designer pane on the right, go to Styles at the top.
    3. Scroll down to Inject Custom CSS and enter your CSS code in the textarea.
    4. Once you’re done, select Save at the bottom.
    5. View your form in Preview or Live mode to check how your form fillers see your form.

    Need help with table to have striped background style Image 1 Screenshot 20

    You can also check my cloned form as a reference.

    Give it a try and reach out again if you have any other questions.

  • Solartime_MAG
    Replied on 19 września 2023 08:57

    Hello thank you for your answer. Its close but i need that column also be 2n+1. Unfortunately always color is on the all box.

    Need help with table to have striped background style Image 1 Screenshot 20

  • Elton Support Team Lead
    Replied on 19 września 2023 20:29

    Hi Solartime_MAG,

    Thanks for getting back to us. Please update your CSS code with the following:

    .form-matrix-column-headers {
        background-color: #5a9bd5 !important;
    }
    .form-matrix-table tbody > tr + tr:nth-child(even){
        background-color:#ddebf8 !important;
    }
    .form-matrix-table tbody > tr + tr:nth-child(odd){
        background-color:#fff !important;
    }
    .form-matrix-row-headers,
    .form-matrix-values,
    .form-matrix-table .form-textbox,
    .form-matrix-table .form-dropdown {
        background-color: transparent !important;
    }

    This will achieve the same style as your example like this:

    Need help with table to have striped background style Image 1 Screenshot 20

    Give it a try and let us know how it goes.

  • Solartime_MAG
    Replied on 20 września 2023 02:47

    Thank you so much. It works! :)