What to do when increasing the number of columns in the list on the management screen causes some columns to be displayed outside the margins

PubDate:

/ ModDate:

WordPress Trouble Shooting and Repair | Personal WP Customization Notes (PWCN)

<Description based on the Act on Premiums and Representations> The content on this site may include product promotions.

When you increase the number of columns on the WordPress management screen, they may be displayed outside the column as shown in the red frame below.

管理画面の列があふれた状態の画像

This can be resolved fairly easily using the method below, so I’m posting it as a memo.

How to prevent the admin screen columns from overflowing

Causes of overflowing lines

The main cause of overflowing columns on the management screen is that the style settings (style code) for the overflowing column are missing, and the columns displayed to the right (after) of the column with the missing style. Occurs only if there is no.

Therefore, you may get the impression that this will suddenly happen at some point.

Resolve overflowing columns by giving them style

First, while the overflowing column is displayed, check the CSS class for that column in the console (open with Developer Tools – “F12”).

In the example image above, it looks like this.

管理画面の列に設定されているCSSクラスを調べる

The style code for this column looks like this.

.widefat tfoot tr td, .widefat tfoot tr th, .widefat thead tr td, .widefat thead tr th {
    color: #2c3338;
}

No style is specified specifically for this column (this is what causes the overflow).

To solve this, add the following style.

.column-imsanity {
    width: 10%;
}

However, it is necessary to apply the style on the management screen side, and even if you add code to the theme’s additional CSS etc., it will not be reflected. If your theme has a stylesheet for it, add it there; if not, add the code below to functions.php of the enabled theme.

function pwcn_admin_column_style_init(){
?>
<style>
.column-imsanity {
    width: 10%;
}
</style>
<?php
}
add_action('admin_footer','pwcn_admin_column_style_init');

In this example, the column output by the “Imsanity” plugin happened to overflow, so be sure to check the CSS class for a specific column using the developer tools each time.

.column-column name

This page is an English translation of the Japanese page. The information on the Japanese page may be more accurate because we maintain the Japanese page as the basis and not all content matches.
You can view the Japanese page by clicking the “View Japanese Page” button on the top right of the page, so please take a look.

If you found the content posted on this page or the reference code introduced helpful, please leave a comment in the comment section at the end of the page, or spread the word on SNS etc.

The methods and codes posted on this page have been confirmed to work in my environment as of the last update date. Please note that in principle, we will not respond even if we receive information about malfunctions or detailed customization methods in the comments section.

Until the end Thank you for reading.

The copyright and ownership of all content published on this page, including texts, images, and codes, belongs to this site, and reproduction is strictly prohibited.