function drush_format_table

8.0.x output.inc drush_format_table($rows, $header = FALSE, $widths = array(), $console_table_options = array())
6.x output.inc drush_format_table($rows, $header = FALSE, $widths = array(), $console_table_options = array())
7.x output.inc drush_format_table($rows, $header = FALSE, $widths = array(), $console_table_options = array())
master output.inc drush_format_table($rows, $header = FALSE, $widths = array(), $console_table_options = array())

Format a table of data.

Parameters

$rows: The rows to print.

$header: If TRUE, the first line will be treated as table header.

$widths: An associative array whose keys are column IDs and values are widths of each column (in characters). If not specified this will be determined automatically, based on a "best fit" algorithm.

array $console_table_options: An array that is passed along when constructing a Console_Table instance.

Return value

$output The formatted output.

Related topics

6 calls to drush_format_table()

File

includes/output.inc, line 271

Code

function drush_format_table($rows, $header = FALSE, $widths = array(), $console_table_options = array()) {
  $tbl = _drush_format_table($rows, $header, $widths, $console_table_options);
  $output = $tbl->getTable();
  if (!drush_is_windows()) {
    $output = str_replace("\r\n", PHP_EOL, $output);
  }
  return $output;
}