Download the PHP package tlr/html-table-builder without Composer

On this page you can find all versions of the php package tlr/html-table-builder. 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 html-table-builder

HTML Table Builder

Build Status

A class-based, "fluent" HTML table builder in PHP.

Installation

Basic Usage

You can see much of the functionality in the above example. More detailed explanations are below.

Reference

Table

The table object represents a top level HTML table.

See Classable below for information on setting the rows' classes.

See Attributable below for information on setting other attributes on the cell element.

It has four other main methods.

$table->render()

This is a helpful shortcut to doing the following:

If you want to pretty print the HTML in your table, you can set it like so:

$table->header() $table->body() $table->footer()

These all return a table section object (see below).

These will be initialised the first time you call the function, so if you never call ->header(), then a <thead> section will not be rendered.

You can call them multiple times, and they will return the same object.

Section (thead, tbody, tfoot)

These objects represent sections in a table.

See Classable below for information on setting the rows' classes.

See Attributable below for information on setting other attributes on the cell element.

There are two other methods to talk about here.

$section->row()

This initialises and returns a new Row object. Calling it multiple times will add multiple rows to the table.

$section->nextRow(Row $current)

Returns the next row in its children from the one passed to it.

Throws an error if passed a row that is not one of its children.

See the code example for the logic of how this works.

Row

These objects represent rows in a table section.

See Classable below for information on setting the rows' classes.

See Attributable below for information on setting other attributes on the cell element.

$row->addCell(CellInterface $cell)

This adds a new cell to the row. You can use this to add a custom cell to the row.

The following helper methods use this method to add the basic included cell types.

Cells

These objects represent cells in a table row.

See Spannable below for information on setting the column spanning.

See Classable below for information on setting the cells' classes.

See Attributable below for information on setting other attributes on the cell element.

Content Cell

This is the default cell. It is fairly versatile, although basic.

You can set the content on initialiastaion, or by calling the ->content(string $content) method.

The default behaviour is to escape the content. If you want to override this, chain in the ->dontEscape() or ->raw() methods.

There is a ->wrapContent(string $open, string $content, string $close) method. This lets you enter some unescaped HTML that wrap some escaped content. Essentially, all this does is escape the $content value, then concatenate them in order, and set the cell to ->raw() or ->dontEscape(). Nevertheless, it can still be helpful - allowing you to mix your own unescaped HTML with some content that should be escaped.

As with any unescaped content, it is up to you to ensure the HTML is valid.

See below for some examples.

Link Cell

A link cell is a cell with a link in it. Other than the link argument to its constructor, it behaves like a ContentCell

Image Cell

Traits

Spannable

On the Cell objects, you can call:

This returns the element object for chaining.

Classable

On any of the element objects - Table, Section, Row, Cell, you can set the class. The following three examples all result in <table class="ui table">:

This returns the element object for chaining.

Attributable

You can set any other HTML attribute:

This returns the element object for chaining.


All versions of html-table-builder with dependencies

PHP Build Version
Package Version
No informations.
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 tlr/html-table-builder contains the following files

Loading the files please wait ....