Review Before Submit: Fix Table Layout Using Custom CSS Codes

  • cigarsurveys
    Asked on July 3, 2025 at 1:14 PM

    Hi,

    Please help fix the table during the review of answers.

    Review Before Submit: Fix Table Layout Using Custom CSS Codes Image 1 Screenshot 20

  • Aries JotForm Support
    Replied on July 3, 2025 at 2:13 PM

    Hi Dan,

    Thanks for reaching out to Jotform Support. I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

  • Aries JotForm Support
    Replied on July 3, 2025 at 3:01 PM

    Hi Dan,

    To fix the table layout in mobile preview mode, you can inject custom CSS into your form. Let me show you how to do this using a cloned version of your form.

    1. First, copy this code:

    @media screen and (max-width: 600px) {
      table.table-grid {
        width: 100% !important;
        table-layout: auto;
        border-collapse: collapse;
      }

      .table-grid th,
      .table-grid td {
        font-size: 12px !important;
        padding: 6px 4px !important;
        text-align: center;
        white-space: nowrap!important; /* Allow breaking */
        word-break: break-word !important;
      }
      .table-grid th:first-child,
      .table-grid td:first-child {
        text-align: left;
        width: 40% !important;
      }
      .table-grid th:nth-child(2),
      .table-grid td:nth-child(2),
      .table-grid th:nth-child(3),
      .table-grid td:nth-child(3),
      .table-grid th:nth-child(4),
      .table-grid td:nth-child(4) {
        width: auto !important;
      }
      .form-matrix-value-tr td img {
        max-width: 16px;
        height: auto;
      }
      table.table-grid::-webkit-scrollbar {
        display: none;
      }
      table.table-grid {
        -ms-overflow-style: none; 
        scrollbar-width: none;     
      }
    }

    2. In Form Builder, click on the Paint Roller icon on the right side of the page to open Form Designer.

    3. Now, in the Form Designer menu, click on the Styles tab, scroll down and paste the code into the Inject CSS Code box. That’s it. The code is automatically saved.

    Review Before Submit: Fix Table Layout Using Custom CSS Codes Image 1 Screenshot 30

    Here's the sample result after injecting the custom CSS codes:

    Review Before Submit: Fix Table Layout Using Custom CSS Codes Image 2 Screenshot 41

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

  • cigarsurveys
    Replied on July 4, 2025 at 12:25 AM

    Hi Aries,

    Thank you for providing the answer, and it worked.

    Could you fix the form buttons as well?

    Review Before Submit: Fix Table Layout Using Custom CSS Codes Image 1 Screenshot 20 Screenshot 10

  • Afzal JotForm Support
    Replied on July 4, 2025 at 2:05 AM

    Hi Dan,

    Glad to know that the solution provided by my colleague worked for you. As for your other question, I've moved that to a new thread. You can check that out here.

    Let us know if there's anything else we can help you with.

  • martinezangel32372
    Replied on July 5, 2025 at 1:43 AM
    table-layout: auto;
       border-collapse: collapse;
     }

      .table-grid th,
      .table-grid td {
       font-size12px !important;
       padding6px 4px !important;
       text-align: center;
       white-space: nowrap!important/* Allow breaking */
       word-break: break-word !important;
     }
      .table-grid th:first-child,
      .table-grid td:first-child {
       text-align: left;
       width40% !important;
     }
      .table-grid th:nth-child(2),
      .table-grid td:nth-child(2),
      .table-grid th:nth-child(3),
      .table-grid td:nth-child(3),
      .table-grid th:nth-child(4),
      .table-grid td:nth-child(4) {
       width: auto !important;
     }
      .form-matrix-value-tr td img {
       max-width16px;
       height: auto;
     }
      table.table-grid::-webkit-scrollbar {
       display: none;
     }
      table.table-grid {
       -ms-overflow-style: none; 
       scrollbar-width
    : none;   
     }
    }


  • Raymond JotForm Support
    Replied on July 5, 2025 at 3:20 AM

    Hi martinezangel32372,

    To avoid confusion, I moved your other question to a new thread and helped you with that here.

    Reach out again if you need any help.