Title: Wrong column width in table header row
Last modified: January 4, 2025

---

# Wrong column width in table header row

 *  Resolved [ronald-jan](https://wordpress.org/support/users/ronald-jan/)
 * (@ronald-jan)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wrong-column-width-in-table-header-row/)
 * Hi Tobias,
   After updating to TablePress 3.0.1 the table row headers have a different
   column width compared to the normal rows below. In the row header the columns
   are the same width, but the normal rows have different width. Because they don’t
   match, it’s hard to read the table correctly. For now I have downgraded the plugin
   to versions 2.4.4, but you can see the differences here:
    - TablePress 2.4.4: [https://freeimage.host/i/tablepress-headers-before.2OehplS](https://freeimage.host/i/tablepress-headers-before.2OehplS)
    - TablePress 3.0.1: [https://freeimage.host/i/tablepress-headers-after.2OehyU7](https://freeimage.host/i/tablepress-headers-after.2OehyU7)
 * Thanks for looking into this!
   Ronald-Jan
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwrong-column-width-in-table-header-row%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wrong-column-width-in-table-header-row/#post-18214921)
 * Hi!
 * Thanks for your post and sorry for the trouble!
 * That does look strange, indeed. I’m not sure why this is happening. To further
   investigate this, please post me a link to the page with the table where this
   problem happens, so that I can take a direct look. Thanks! (Just from the screenshot,
   I can not investigate the cause for this, unfortunately.)
 * Best wishes,
   Tobias
 *  Thread Starter [ronald-jan](https://wordpress.org/support/users/ronald-jan/)
 * (@ronald-jan)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wrong-column-width-in-table-header-row/#post-18214934)
 * Hi Tobias,
 * Thanks! I have updated the plugin again, so you can view the issue on the URL
   that I added to the first post in this topic.
 * Best wishes,
   Ronald-Jan
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wrong-column-width-in-table-header-row/#post-18214968)
 * Hi,
 * ok, thanks for that! I’m not exactly sure, but it might be possible that the 
   method for hiding columns with CSS is no longer compatible here (when Horizontal
   Scrolling is used).
 * Therefore, as a test, please remove this CSS code (from the respective selectors)
   for this table again:
 *     ```wp-block-code
       .tablepress-id-1 .column-7 {   display: none;}.tablepress-id-1 colgroup {  display: none;}
       ```
   
 * Then, instead hide this column with a different method. For that, please add 
   this to the “Custom Commands” text field on the table’s “Edit” screen:
 *     ```wp-block-code
       columnDefs: [  { visible: false, targets: [ 6 ] }]
       ```
   
 * Best wishes,
   Tobias
 *  Thread Starter [ronald-jan](https://wordpress.org/support/users/ronald-jan/)
 * (@ronald-jan)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wrong-column-width-in-table-header-row/#post-18214983)
 * Hi Tobias,
   I removed the following CSS-codes:
 *     ```wp-block-code
       .tablepress-id-1 .column-7, .tablepress-id-2 .column-7,.tablepress-id-4 .column-7{	display: none;}.tablepress-id-3 .column-5,.tablepress-id-5 .column-5,.tablepress-id-7 .column-5{	display: none;}.tablepress-id-1 colgroup, .tablepress-id-2 colgroup, .tablepress-id-3 colgroup, .tablepress-id-4 colgroup, .tablepress-id-5 colgroup, .tablepress-id-6 colgroup, .tablepress-id-7 colgroup {  display: none;}
       ```
   
 * Your code seems to work, except for the tables with ID 3, 5 and 7 which have 
   a different column that needs to be hidden. But after adjusting your code it 
   works there as well.
 *     ```wp-block-code
       columnDefs: [  { visible: false, targets: [ 4 ] }]
       ```
   
 * If you load the page you can see the column for a couple of milliseconds, so 
   unfortunately it’s not as clean and fast as the previous CSS solution. But I’m
   glad that the table header aligns correctly again.
 * Kind regards,
   Ronald-Jan
    -  This reply was modified 1 year, 5 months ago by [ronald-jan](https://wordpress.org/support/users/ronald-jan/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wrong-column-width-in-table-header-row/#post-18215403)
 * Hi!
 * Yes, that would be the procedure for all tables then 🙂 (I wanted to first illustrate
   it for table 1.)
   Good to hear that this helped! I will do some more tests, maybe
   I can find a way to make the previous CSS approach work again. You could maybe
   also try the combined approach (of using both CSS (but with the CSS that targets
   the `colgroup`!) and the “Custom Commands”).Or, if you are not really needing
   the hidden column for anything, you could also hide it directly on the “Edit”
   screen as well, to prevent this visual glitch.
 * Best wishes,
   Tobias

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

The topic ‘Wrong column width in table header row’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/wrong-column-width-in-table-header-row/#post-18215403)
 * Status: resolved