Skip to content

Commit 925732a

Browse files
committed
Add alignments to table
1 parent 41b502b commit 925732a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/DB_Command.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use WP_CLI\Formatter;
44
use WP_CLI\Utils;
5+
use cli\table\Column;
56

67
/**
78
* Performs basic database operations using credentials stored in wp-config.php.
@@ -1145,7 +1146,6 @@ public function size( $args, $assoc_args ) {
11451146
if ( ! empty( $size_format ) && ! $tables && ! $format && ! $human_readable && true !== $all_tables && true !== $all_tables_with_prefix ) {
11461147
WP_CLI::line( str_replace( " {$size_format_display}", '', $rows[0]['Size'] ) );
11471148
} else {
1148-
11491149
// Sort the rows by user input
11501150
if ( $orderby ) {
11511151
usort(
@@ -1166,7 +1166,8 @@ function ( $a, $b ) use ( $order, $orderby ) {
11661166

11671167
// Display the rows.
11681168
$args = [
1169-
'format' => $format,
1169+
'format' => $format,
1170+
'alignments' => [ 'Size' => Column::ALIGN_RIGHT ],
11701171
];
11711172

11721173
$formatter = new Formatter( $args, $fields );

0 commit comments

Comments
 (0)