WordPress.org

Ready to get started?Download WordPress

Forums

WP-Table Reloaded
[resolved] Set Column width and alignment confusion (6 posts)

  1. squeaky_data
    Member
    Posted 1 year ago #

    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

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    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

  3. squeaky_data
    Member
    Posted 1 year ago #

    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;
    }

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    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

  5. squeaky_data
    Member
    Posted 1 year ago #

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

    Thanks for such a great plugin and support!

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

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

    Best wishes,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic