• Resolved martincomputerguy

    (@martincomputerguy)


    Thank you so much for making and supporting your TablePress plugin and extensions!

    Here’s the problem I’m having with TablePress and its Responsive Tables Plugin:

    I created a 5-column table here:
    http://belmontdramaticclub.org/spring

    using this shortcode:
    [table id=21 column_widths=”15%|15%|10%|10%|50%” responsive=”collapse” /]

    And I’ve learned to test the mobile responsiveness in two ways:
    – on my regular computer, by squeezing my web browser’s window width with my mouse,
    – on my regular computer, by changing the User Agent option in my browser to a mobile choice like “Safari for iOS,” and
    – on an iOS or Android phone or tablet.

    The good news:
    – On my computer, when I squeeze my browser’s window width, the table responds beautifully by shrinking the column widths and eventually stacking and collapsing.
    – On a phone or tablet, when I land on my website, the table is already stacked and/or collapsed appropriately, whether I’m in landscape mode (screen is wide and short) or portrait mode (screen is narrow and tall).
    – On a phone or tablet, if I start out in landscape mode and switch to portrait (making the screen narrower), the table gets even narrower and still looks great!

    The bad news:
    – On my computer, having already squeezed my browser’s window width, if I then expand the width back to regular size (most of my 15″ laptop screen’s width), the table does not “recover” properly. The collapsed “plus signs” disappear and the last (widest) column reappears, but all of the column widths are still very narrow, and they only return to their original widths when I Refresh the page.
    – Similarly, on a phone or tablet, if I switch from portrait mode to landscape mode (making the screen get wider), I see exactly the same behavior, where the columns remain unnecessarily narrow, and the only “fix” is to Refresh the page.

    In case it’s relevant, the only CSS overrides I’ve done are:

    /* for all tables: */
    /* override table header & footer background color to white */
    .tablepress thead th,
    .tablepress tfoot th {
    background-color: #ffffff;
    }

    /* override table odd row background color to grey */
    .tablepress .odd td {
    /* background-color: #DCDBE4; */
    }

    /* override table odd row background color to grey */
    .tablepress .even td {
    /* background-color: #DCDBE4; */
    }

    /* override table background color to grey */
    .tablepress tbody td {
    background-color: #DCDBE4;
    border-spacing: 0; /* cellspacing */
    padding: 0; /* cellpadding */
    border: 3px solid #ffffff;
    }

    /* for specific tables: */
    /* override table #21: Spring Show Characters, rows #2, 9, & 14 (e.g., “Principal Male Roles”) background color to white */
    .tablepress-id-21 .row-2 td,
    .tablepress-id-21 .row-9 td,
    .tablepress-id-21 .row-14 td {
    background-color: #ffffff;
    }

    Thanks for any advice you can give me about how I might solve this problem.

    Martin

    https://wordpress.org/plugins/tablepress/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi Martin,

    thanks for your question, and sorry for the trouble.

    I’m not exactly sure, but it might be possible that the DataTables JS library that TablePress uses for the collapse mode, does not support setting custom column widths like that 🙁
    Can you maybe try again without that Shortcode parameter, or by setting the widths via “Custom CSS” (see https://tablepress.org/faq/column-widths/ )?

    Regards,
    Tobias

    Thread Starter martincomputerguy

    (@martincomputerguy)

    Hi Tobias–

    Thank you so much for your fast response. Your support is amazing!

    Two things:

    1. As you suggested, I removed that parameter, which changed my shortcode from:

    [table id=21 column_widths=”15%|15%|10%|10%|50%” responsive=”collapse” /]

    to:

    [table id=21 responsive=”collapse” /]

    but (apart from the columns having relative widths that I don’t like as much as my “15%|15%|10%|10%|50%” proportions) the problem is unchanged: The table does not “recover” properly after “squeezing” then “expanding” the window width.

    Have you seen this problem before?

    Could it be caused by some kind of round-off error in the column width calculations?

    What else can I try? Is there something about my table data that could be causing this? It’s just text.

    2. Looking at your https://tablepress.org/faq/column-widths page, I’m a little confused. Wouldn’t options like “width: 100px” make my columns have fixed widths, which would defeat mobile responsiveness? Can I use options like “width: 15%” instead?

    Update: I just tried this with “15%” etc., but the problem is unchanged.

    Thanks!

    Martin

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Martin,

    thanks for trying all this. My assumption then is that the external DataTables JS library that TablePress uses simply does not listen to “resize” or “orientation change” events that are sent in JS code by the browser. 🙁 Unfortunately, I’m not aware of a solution to this, sorry.
    They’d need to do is as they are calculating pixel values for the widths at runtime, to position certain elements.

    Regards,
    Tobias

    Thread Starter martincomputerguy

    (@martincomputerguy)

    Ok, then is it reasonable to contact that library’s developers to ask about fixing this?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    you could try, but to be honest, you shouldn’t really worry about this issue to much. It’s not really easy to trigger this, right? And thus, it’s rather unlikely that a user is going to see this.

    Regards,
    Tobias

    Thread Starter martincomputerguy

    (@martincomputerguy)

    I appreciate your opinion, but I disagree. Do you never switch your phone or tablet from portrait to landscape? Never widen your computer’s browser window, or click the Maximize button?

    Isn’t mobile responsiveness supposed to provide responsiveness?

    How would I contact that library’s developers?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no, I don’t really do that 🙂 But I agree that other people might.
    The best way might be to use the DataTables support forums at http://www.datatables.net/

    Regards,
    Tobias

    I’m having this issue as well. No CSS overrides, though.

    martincomputerguy, if you find a solution, please post it here!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    do you mean the issue with the change of width when rotating the screen? Yeah, unfortunately, there’s no solution to that at the moment 🙁

    Regards,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Responsive Tables Plugin – Collapse works on shrink, acts poorly when enlarged’ is closed to new replies.