Download the PHP package gbhorwood/tabletown without Composer

On this page you can find all versions of the php package gbhorwood/tabletown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tabletown

Tabletown

License Version PHP Version Require

Tabletown is a php package for converting data, such as arrays, into nice ascii/ansi tables, similar to MySql's standard output.

Tabletown can accept input from arrays, PDO statements, and eloquent collections. It properly handles multibyte characters, including emojis, as well as unprintable ansi character sequences and tabs. It allows setting per-column alignment and offers a number of border style options.

Tabletown was developed as an internal-use tool for fruitbat studios/cloverhitch technologies/kludgetastic implementations.

Install

Tabletown is installed via composer:

Features

Tabletown's basic features are:

Quickstart

Tabletown has one static method get(). The fastest way to create and print a table is to provide the get() method with two arguments: an array of headers, and an array of data for table rows.

The above example will output the table:

Building tables from arrays

Tables can be built from arrays in one of two ways: either with two separate arrays for the headers and rows, or with one associative array.

Using separate arrays for headers and rows

Using one associative array

Note: Tabletown will throw an exception if the column counts do not match for all rows.

Building tables from PDO statements

Tabletown can build tables from a PDOStatement object returned from the PDO query() method:

Building tables from Eloquent collections

Eloquent collection objects can be used to build tables:

Styling borders

Tabletown has three different types of borders that can be set by passing one of the border constants as an argument. The border style constants are:

The usage and output of the border styles is:

TABLE_BORDER_STANDARD

TABLE_BORDER_SOLID

TABLE_BORDER_DOUBLE

Aligning columns

Columns in tables are left-aligned by default. Aligments can be changed by passing an array of alignment constants after the border style constant argument.

The valid alignment constants are:

Note that null values are considered LEFT.

The above example will output:

Multiple line handling

Tabletown perserves new lines in the input data, creating multi-line rows in the table.

For instance, this example creates rows with pretty-printed json

and outputs:

Note: The linebreak characters used are those for the platform running Tabletown as defined by the PHP_EOL constant.

Tab handling

Tabs are handled in Tabletown as tab stops on eight spaces on a per-line basis. This allows vertically aligning text on tab stops across multiple lines. For example:

Will output:


All versions of tabletown with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gbhorwood/tabletown contains the following files

Loading the files please wait ....