lucasjs7/simple-cli-table 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lucasjs7/simple-cli-table

最新稳定版本:v1.04

Composer 安装命令:

composer require lucasjs7/simple-cli-table

包简介

A simple lib to render tables in php.

README 文档

README

A simple lib to render tables in php.

Example 1

# Code:
$data = [
	['First Name', 'Last Name', 'Age'],
	['Steve',      'Magal',     '37'],
	['Jorel',      'Seila',     '14'],
	['William',    'Shostners', '9'],
	['Carlos',     'Felino',    '39'],
];

echo SimpleCliTable::build($data);

# Output:
+------------+-----------+-----+
| First Name | Last Name | Age |
+------------+-----------+-----+
| Steve      | Magal     | 37  |
| Jorel      | Seila     | 14  |
| William    | Shostners | 9   |
| Carlos     | Felino    | 39  |
+------------+-----------+-----+

Example 2

# Code:
$data = [
	['Steve',      'Magal',     '37'],
	['Jorel',      'Seila',     '14'],
	['William',    'Shostners', '9'],
	['Carlos',     'Felino',    '39'],
];

$simpleTableCli = new SimpleCliTable;
$simpleTableCli->setContainsHeader(false);

foreach ($data as $line) {
	$simpleTableCli->add($line);
}

echo $simpleTableCli->render();

# Output:
+---------+-----------+----+
| Steve   | Magal     | 37 |
| Jorel   | Seila     | 14 |
| William | Shostners | 9  |
| Carlos  | Felino    | 39 |
+---------+-----------+----+

Install using composer

composer require lucasjs7/simple-cli-table

统计信息

  • 总下载量: 51
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-14