• Resolved dalai2017

    (@dalai2017)


    Hi Tobias

    We have some Biography tables for our company employees on our website using TablePress: https://dalaigroup.com/company/

    An image is included for each of the biography entries, but they aren’t appearing at their natural size.

    If I don’t set a cell width for each of the image cells, they appear in a range of unnatural sizes. Anywhere from 88px to 180px in width on desktop.

    The natural image sizes for each are all very close in size (180px). Right now, I have the images cell widths set to 180px, which isn’t great for mobile.

    I’m not sure where or how I should be working in percentages. What it the best way to keep everything in proportion? I’m not sure if I should be adding style information to the inserted image on the table side, or if there may be ideal CSS to use in the Plugin Options section. The images should be appearing full-size and responsive, if possible.

    Thanks for taking a look. Any advice would really help.

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    If you want the columns to appear at the same size, you will have to set column widths, and/or widths for the images.
    On mobile, I recommend to set a smaller width, e.g. using a CSS3 Media Query.

    As you have quite a few tables on that page, I would recommend to use the page ID in the CSS. That way, you don’t have to add the CSS for each table individually.

    So, something like this maybe:

    .page-id-546 .tablepress .column-1 img {
      width: 180px;
    }
    
    @media screen and (max-width: 768px) {
      .page-id-546 .tablepress .column-1 img {
        width: 90px;
      }
    }
    

    Note that the text in your table also has an effect on the width. For example, a first column will never be smaller than the name in the header (which for example affects “Stephanie” most). Also, the second column will never be smaller than the email addresses that you are showing, as the browser treats these as one very long word – to which it can not add line breaks automatically.

    Regards,
    Tobias

    Thread Starter dalai2017

    (@dalai2017)

    Thank you for all of this information.

    I set the column width to 15% and the images look great on desktop and medium size screens. It seems to only be an issue on smartphone devices or extra small screens.

    It actually looks like the text width is the sole factor creating the varying column widths on extra small screens. Some of them have resized to 15% of the phone screen correctly. But, the ones with longer words in the column did not resize correctly.

    Is there any way I can treat the text as percentages? Or is there something that will resize the text proportionately? Right now I’m using pixels and I’m wondering if that’s something I can control differently to help.

    Thank you

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    yes, that’s correct. The ones with longer words can not resize to small values. After all, the text has to go somewhere, and therefore, the browser will make the columns wider.
    You would have to add CSS to reduce the font size on small screens, like

    @media screen and (max-width: 768px) {
      .page-id-546 .tablepress .column-1 {
        font-size: 12px;
      }
    }

    Having such a proportional scaling done automatically is not possible, unfortunately ??

    Regards,
    Tobias

    Thread Starter dalai2017

    (@dalai2017)

    Thanks for the media query recommendations! I may even look into a new table format just for mobile devices.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    yes, that might be a good idea. Tables are tough to get right on small screens ??

    Regards,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Responsive Table Images’ is closed to new replies.