• Resolved ThomasCrown

    (@thomascrown)


    Hi Tobias,

    What a great plugin …

    I have a quick question though concerning fixed width tables.

    I understand that there have been quite a few postings on the subject; however, I seem to have the opposite problem.

    Some of my tables have only 2 columns and just 2-3 rows of data. There’s no need for them to span the entire width of the page. Hence, I would like to reduce the width of these tables to a fixed width of about 250px or 350px. How would I need to go about this?

    I tried some CSS code that was suggested in a posting concerning custom width columns, but this didn’t have any effect.

    I would appreciate any pointers.

    Cheers!

    https://ww.wp.xz.cn/plugins/tablepress/

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.

    For that, you could simply use some “Custom CSS” on the “Plugin Options” screen like

    .tablepress-id-123 {
      width: 250px;
    }

    to get a fixed width, or

    .tablepress-id-123 {
      width: auto;
    }

    to have the table expand to just slightly more than the content in it.
    The 123 in that code needs to be changed to the table ID.

    If this code doesn’t work, can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Thread Starter ThomasCrown

    (@thomascrown)

    Thanks for the ultra-fast response, Tobias. It really seems you are on top of this. Great.

    I tried this before, but it didn’t have any effect on the table. I have to mention thought that I am using some <div> tags on this page, as I am working with a Open Streets map and some images that I need to incorporate into my page layout.

    Unfortunately, my site isn’t live yet, so I can’t send you a link. But here is some of the code I used. Could this cause the conflict?

    <div style=”padding-top: 20px;”>
    <h4>Tour Dates</h4>
    [table id=3 /]
    *Additional dates upon request
    </div>

    Many thanks for your time and help with this.

    Cheers!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    I don’t think that the <div>s have to do with this, but there might be some other CSS in the page that is more “aggressive”, so that we have to become more aggressive as well, by adding the !important keyword:

    .tablepress-id-123 {
      width: 250px !important;
    }

    If that also doesn’t help, we’ll have to wait until the site is live, as I’d then really need to investigate the page more closely.

    Regards,
    Tobias

    Thread Starter ThomasCrown

    (@thomascrown)

    This did it, Tobias.

    Many thanks, you really rock!

    Cheers!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

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

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter ThomasCrown

    (@thomascrown)

    Habe soeben mein 5-Sterne Rating hinterlassen. Nochmals aller herzlichsten Dank und viele Gruesse nach Magdeburg.

    Cheers!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    danke! 🙂 Freut mich sehr!

    Viele Grüße,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Fixed Width Tables’ is closed to new replies.