PHP Classes

File: vendor/wp-cli/php-cli-tools/examples/table.php

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Nolimitbuzz WP Theme   vendor/wp-cli/php-cli-tools/examples/table.php   Download  
File: vendor/wp-cli/php-cli-tools/examples/table.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Nolimitbuzz WP Theme
WordPress theme to used as start of new themes
Author: By
Last change:
Date: 1 month ago
Size: 1,919 bytes
 

Contents

Class file image Download
<?php

require_once 'common.php';
/*
 * Please notice that the data has to be an 0-based array,
 * not an associative one if you intend to work with custom
 * column widths.
 */
$headers = array('First Name', 'Last Name', 'City', 'State');
$data = array(
    array(
'Maryam', 'Elliott', 'Elizabeth City', 'SD'),
    array(
'Jerry', 'Washington', 'Bessemer', 'ME'),
    array(
'Allegra', 'Hopkins', 'Altoona', 'ME'),
    array(
'Audrey', 'Oneil', 'Dalton', 'SK'),
    array(
'Ruth', 'Mcpherson', 'San Francisco', 'ID'),
    array(
'Odessa', 'Tate', 'Chattanooga', 'FL'),
    array(
'Violet', 'Nielsen', 'Valdosta', 'AB'),
    array(
'Summer', 'Rollins', 'Revere', 'SK'),
    array(
'Mufutau', 'Bowers', 'Scottsbluff', 'WI'),
    array(
'Grace', 'Rosario', 'Garden Grove', 'KY'),
    array(
'Amanda', 'Berry', 'La Habra', 'AZ'),
    array(
'Cassady', 'York', 'Fulton', 'BC'),
    array(
'Heather', 'Terrell', 'Statesboro', 'SC'),
    array(
'Dominic', 'Jimenez', 'West Valley City', 'ME'),
    array(
'Rhonda', 'Potter', 'Racine', 'BC'),
    array(
'Nathan', 'Velazquez', 'Cedarburg', 'BC'),
    array(
'Richard', 'Fletcher', 'Corpus Christi', 'BC'),
    array(
'Cheyenne', 'Rios', 'Broken Arrow', 'VA'),
    array(
'Velma', 'Clemons', 'Helena', 'IL'),
    array(
'Samuel', 'Berry', 'Lawrenceville', 'NU'),
    array(
'Marcia', 'Swanson', 'Fontana', 'QC'),
    array(
'Zachary', 'Silva', 'Port Washington', 'MB'),
    array(
'Hilary', 'Chambers', 'Suffolk', 'HI'),
    array(
'Idola', 'Carroll', 'West Sacramento', 'QC'),
    array(
'Kirestin', 'Stephens', 'Fitchburg', 'AB'),
);

$table = new \cli\Table();
$table->setHeaders($headers);
$table->setRows($data);
$table->setRenderer(new \cli\table\Ascii([10, 10, 20, 5]));
$table->display();