• Resolved Bunkermentality

    (@bunkermentality)


    I use the table plugin for static tables in the Information tab on the pagelink.

    The latest upgrade of TablePress 3.0.1 causes the alignment of the table to reset to centered for all columns even though left align is selected.

    If I rollback to version 3.0 the problem disappears.

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi!

    Thanks for your post and sorry for the trouble!

    Can you please clarify this some more? I’m not seeing a TablePress table on the page from your link?

    Regards,
    Tobias

    Thread Starter Bunkermentality

    (@bunkermentality)

    Thank you for your prompt reply. I detected this problem for the first time yesterday.

    It is the presence of the TablePress plugin that affects the stand WordPress Table block https://www.ads-software.com/documentation/article/table-block/.

    With V3.0.1 the alignment button does nothing and the table alignments are left-aligned whicl rendered display is center-aligned. With V3.0.0 the edit scree shows centrer-aligned and the rendered scree is left-aligned. For V2.4.4 both edit and rendered pages show center-aligned.

    Yesterday I updgraded tablePress to v3.0.1 and deactivated the deprecated TablePress Extensions.

    If I deactivate TablePress completely the Table Block works OK.

    Regards, Paul

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for the explanation! I think I can explain what’s going on here.

    So, TablePress does in no way interact or influence the normal WordPress table block. However, it offers a “Custom CSS” field on its “Plugin Options” screen, which can hold CSS code for styling.

    In this “Custom CSS” field, you have this code (among other code):

    .table th,
    td {
    text-align: center !important;
    }

    This will center-align ALL table body cells of ALL tables on the website (not just those of TablePress, but also those of the WordPress Table block). The relevant part is the td here. The part with the .table is actually not used (because that’s not a CSS class that TablePress uses).

    In TablePress 2.4.4, this “Custom CSS” is loaded on all pages of the site, so that it will affect all tables. In TablePress 3.0 and 3.0.1 (after fixing a bug in 3.0), this CSS file will only be loaded on pages where there is a TablePress table. So, on the page from your link, which does not have a TablePress table, this “Custom CSS” file will NOT be loaded, meaning that the table from the WordPress Table block will get its default styling.

    In short: To fix this problem, you should adjust your “Custom CSS” on the “Plugin Options” screen of TablePress. It should only contain CSS code for TablePress tables, which means that all CSS selectors should start with .tablepress (and not just .table and not without a CSS class, like the td). So, I recommend either removing the code from above, or replacing it with

    .tablepress th,
    .tablepress td {
    text-align: center !important;
    }

    (There is also another piece of code in there that uses just .table so that should be adjusted or commented out as well.)

    After this, your WordPress Table block tables will be completely independent from TablePress.

    Best wishes,
    Tobias

    Thread Starter Bunkermentality

    (@bunkermentality)

    Tobias,

    Thatnks for the update. This makes sense. In response I have

    1. Updated the plugin to v3.0.1
    2. Edidted the CSS in plugin options (CSS appended).
    3. Created a test page https://respiceprospice.co.uk/tablepress-test In edit mode this seems to aligh columns as requested. But when rendered both colums default to centered.

    Thanks Paul

    +++++++++++

    .tablepress th {
    background-color: #046546; /* Ealing Dark Green */
    color: #ffffff;
    text-align: center !important;
    }

    .tablepress th,
    td {
    text-align: center !important;
    }

    .tablepress .column-1 {
    text-align: left !important;
    }

    /* ID=8 Club Fixtures & Results 1871 – present */
    .tablepress-id-8 .column-2 {
    text-align: left !important;
    }

    /* ID=9 In Memoriam */
    .tablepress-id-9 .column-1 {
    text-align: right !important;
    }

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    you still have

    .tablepress th,
    td {
    text-align: center !important;
    }

    which is wrong and must be

    .tablepress th,
    .tablepress td {
    text-align: center !important;
    }

    Best wishes,
    Tobias

    Thread Starter Bunkermentality

    (@bunkermentality)

    Tobias,

    Excellent. Thank you for your assistance.

    Paul

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.