• thepremierviewpodcast

    (@thepremierviewpodcast)


    Hi all,

    I’ve added nine different scoring tables to the site using the TablePress plugin with match records going back through the years. On desktop everything looks fine, but on mobile view the score columns don’t line up correctly. The scores and headers should all sit on the same row and align across, but instead the score numbers are stacking under each other. I’m not sure if it’s a CSS issue or something with the responsive settings in TablePress.

    Could someone please take a look and get back to me so we can resolve it? I’ve included the link here:
    https://laoisgaa.ie/laois-u20-21-hurling-championship-games-1964-2025/

    Thanks in advance.

    Padraigh

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi Padraigh,

    Thank you for reaching out, and sorry for your trouble.

    The cause for this basically is that your table is wider than the available screen width on smaller screens, like phones. The browser then doesn’t want to make the table even wider, so that it uses all possibilities it has for making the table more narrow, including line breaks at characters where this is normally done. Fortunately, we can prevent the cell content breaking into multiple lines here, by adding a small piece of CSS code.

    For that, please go to your WordPress dashboard > TablePress > Plugin Options > Custom Styling > Custom CSS and add the following CSS code to the field:

    .tablepress-id-21 .column-6,
    .tablepress-id-21 .column-8 {
    white-space: nowrap;
    }

    This will cause the header and body cells of the score columns (numbers 6 and 8) of this table to not break their content into multiple lines.

    You can copy this code for other such tables as well, and adjust the table ID and column numbers as needed.

    If there are more tables that shows this behavior, and where the scores are in columns 6 and 8, you can simplify this process and code for these tables by using an “Extra CSS class”: On the “Edit” screens of the relevant tables, add e.g. tablepress-table-scores-6-8 to the “Extra CSS classes” field, and then change that CSS code (just once) to

    .tablepress-table-scores-6-8 .column-6,
    .tablepress-table-scores-6-8 .column-8 {
    white-space: nowrap;
    }

    This way, there will be just one common block of CSS code for multiple tables, and the code will be “assigned” to the table by configuring the “Extra CSS class” for them.

    Best wishes,
    Tobias

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.