PHP code example of kba-team / markdown-table

1. Go to this page and download the library: Download kba-team/markdown-table library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kba-team / markdown-table example snippets



use kbATeam\MarkdownTable\Table;
use kbATeam\MarkdownTable\Column;
$data = [
  [
    'A' => 'markdown',
    'B' => 'is'
  ],
  [
    'A' => 'great',
    'B' => 'software',
  ]
];
$table = new Table();
$table->addColumn('A', new Column('Column A', Column::ALIGN_RIGHT));
$table->addColumn('B', new Column('another Column', Column::ALIGN_LEFT));
foreach ($table->generate($data) as $row) {
  printf('%s%s', $row, PHP_EOL);
}