This commit is contained in:
2024-08-06 12:10:26 +03:00
parent f53346610e
commit 71b2fdfb6b
5 changed files with 65 additions and 69 deletions

View File

@ -8,15 +8,15 @@ $json = file_get_contents('simple.json');
$table = new ListJsonTable($json);
//$table->columns([
$table->setBeforePrintCell([
'status' => function ($ceil) {
return getStatusLabel()[$ceil];
$table->columns([
'status' => function ($cell) {
return getStatusLabel()[$cell];
},
'email' => function ($ceil) {
return "<span style='color: aqua'>$ceil</span>";
'email' => function ($cell) {
return "<span style='color: aqua'>$cell</span>";
},
'description' => function ($ceil) {
return "<span style='color: sienna'>$ceil</span>";
'description' => function ($cell) {
return "<span style='color: sienna'>$cell</span>";
}
]);
//$table->setBeforePrintCell(function ($key, $data) {

View File

@ -8,12 +8,12 @@ $json = file_get_contents('view.json');
$table = new ViewJsonTable($json);
//$table->rows([
$table->setBeforePrintCell([
'username' => function ($ceil) {
return "<span style='color: aqua'>$ceil</span>";
$table->rows([
'username' => function ($cell) {
return "<span style='color: aqua'>$cell</span>";
},
'email' => function ($ceil) {
return "<span style='color: firebrick'>$ceil</span>";
'email' => function ($cell) {
return "<span style='color: firebrick'>$cell</span>";
}
]);
$table->create();