• Resolved ryangerlach

    (@ryangerlach)


    Hey Tobias,

    First of all, thanks for this wonderful plug-in!

    I’m having trouble with a table where the CSS I’m adding isn’t having any effect on my table.

    I want the first column to be 300px wide, and every other column 50px wide. This is the CSS I’m using:

    .tablepress-id-12 .column-1 {
    	width: 300px;
    	padding: 0;
    }
    
    .tablepress-id-12 .column-2,
    .tablepress-id-12 .column-3,
    .tablepress-id-12 .column-4,
    .tablepress-id-12 .column-5,
    .tablepress-id-12 .column-6,
    .tablepress-id-12 .column-7,
    .tablepress-id-12 .column-8,
    .tablepress-id-12 .column-9,
    .tablepress-id-12 .column-10,
    .tablepress-id-12 .column-11,
    .tablepress-id-12 .column-12,
    .tablepress-id-12 .column-13,
    .tablepress-id-12 .column-14,
    .tablepress-id-12 .column-15,
    .tablepress-id-12 .column-16,
    .tablepress-id-12 .column-17,
    .tablepress-id-12 .column-18,
    .tablepress-id-12 .column-19,
    .tablepress-id-12 .column-20,
    .tablepress-id-12 .column-21,
    .tablepress-id-12 .column-22,
    .tablepress-id-12 .column-23,
    .tablepress-id-12 .column-24 {
    	padding: 0;
    	width: 50px;
    }

    If you could please tell me what’s wrong that’d be great.

    Cheers!

    PS Just sent you some money for a couple of cups of coffee!

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

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.
    Also, thanks for the donation, I really appreciate it!

    This issue is, to some degree caused by the theme CSS, but also by the fact that the number of columns might be too many to fit. Please try changing

    padding: 0;
    

    to

    padding: 0 !important;
    

    In addition, you could maybe add

    vertical-align: middle;
    

    for better spacing.
    Finally, you could try adding

    .tablepress-id-12 {
      table-layout: fixed;
    }

    which might lead to the width being used in a more consistent manner by the browser.

    Regards,
    Tobias

    Thread Starter ryangerlach

    (@ryangerlach)

    Tobias, I could kiss you!

    This worked perfectly.

    Thank you so much.

    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!

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

The topic ‘CSS not having any effect on column width’ is closed to new replies.