1. Change source code
<div class="wp-list-table-container" style="overflow-x:auto;"> <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> <thead> <tr> <?php $this->print_column_headers(); ?> </tr> </thead> <tbody id="the-list" <?php if ( $singular ) { echo " data-wp-lists='list:$singular'"; } ?> > <?php $this->display_rows_or_placeholder(); ?> </tbody> <tfoot> <tr> <?php $this->print_column_headers( false ); ?> </tr> </tfoot> </table> </div>
wp-admin\includes\class-wp-list-table.php line 1276~1299
在渲染HTML表格外,加上父div wp-list-table-container,style=overflow-x:auto。
2. set td fixed with
.post-type-algo-trade-record .wp-list-table th {width: 200px;}
set table css
这样就能实现表格左右滚动。