• Resolved squeaky_data

    (@squeaky_data)


    I am trying to set the column width and center the text for for two specific columns.

    If I reference the column by the column letter it sets the width correctly but not the alignment. If I reference the column by the column number it sets the alignment correctly but not the width. I have not been able to figure out how to get the both alignment and width to work in the CSS included below.

    .wp-table-reloaded-id-2 .column-F {
    width: 100px!important;
    text-align:center!important;
    }

    .wp-table-reloaded-id-2 .column-7 {
    text-align:center!important;
    width: 100px!important;
    }

    Table Site

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

    (@tobiasbg)

    Hi,

    thanks for your questions.

    It is not possible to use columns letters in the CSS, and they have no effect.
    So, using

    .wp-table-reloaded-id-2 .column-7 {
      text-align:center!important;
    }

    will give you the correct alignment, and the width that you would be getting if column letters in CSS were supported.

    Now, if you could clarify what exactly you are trying to do with the widths, I’ll gladly try to suggest the best code for this.

    Regards,
    Tobias

    Thread Starter squeaky_data

    (@squeaky_data)

    Thanks for the quick response Tobias.

    When I first posted my link to the table didn’t work so I added it to the original post and below:

    Table Link

    Referencing the column letter did work as the following css is still in use on the linked table if you are curious. What I was trying to do was center the column text and set the column width to 100px. Using the column number it will center but not set the 100px width.

    .wp-table-reloaded-id-2 .column-F {
    width: 100px!important;
    text-align:center!important;
    }

    .wp-table-reloaded-id-2 .column-7 {
    text-align:center!important;
    width: 100px!important;
    }

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yeah, I noticed the link at the bottom and checked the page 🙂

    And trust me, the column letter does not work! That’s because WP-Table Reloaded only uses the column number in the CSS classes of the cells, but not the letter. The corresponding code that you added with the column letter has no effect.

    Now, the width is working fine for me. The seventh (i.e. the last) column is 100px wide. Also, all cells are centered.

    Regards,
    Tobias

    Thread Starter squeaky_data

    (@squeaky_data)

    That fixed it, I think I was seeing some local caching issues.

    Thanks for such a great plugin and support!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    great 🙂 Yes, caching could explain this. Good to hear that it now works for you, too 🙂

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Set Column width and alignment confusion’ is closed to new replies.