How to remove the bottom table headers (column names) in WP_List_Table?

admin2025-04-19  0

By default, the WP_List_Table has column names at the top and the bottom of the table.

How can I remove the bottom table headers? Thanks.

p.s. I have already subclassed the WP_List_Table.

By default, the WP_List_Table has column names at the top and the bottom of the table.

How can I remove the bottom table headers? Thanks.

p.s. I have already subclassed the WP_List_Table.

Share Improve this question asked Oct 22, 2019 at 2:01 RaptorRaptor 2721 gold badge3 silver badges24 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You can override the WP_List_Table::display() method and remove the tfoot which contains the bottom table headers:

<tfoot>
<tr>
    <?php $this->print_column_headers( false ); ?>
</tr>
</tfoot>

Or you can add a specific class to the relevant admin page and use CSS to visually hide the bottom table headers:

.my-plugin-foo-page table.wp-list-table > tfoot {
    display: none;
}
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745062745a282799.html

最新回复(0)