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

On this page you can find all versions of the php package ramondev/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 and render HTML tables from an array or Eloquent collection, with dynamic columns, per-cell formatting, custom HTML attributes, output escaping, pagination, and an empty state — all from plain PHP, no Blade component boilerplate required in your own app.

Requirements

Installation

The service provider (Ramondev\HtmlTableBuilder\HTMLTableBuilderProvider) auto-registers via Laravel's package discovery — no manual step needed. It registers the package's Blade view under the views:: namespace, so the view file ships with the package rather than living in your app's resources/views.

Quick start

By default this renders every key found across the rows as a column, with values HTML-escaped.

Constructing a table

$data can be:

Columns are auto-detected as the union of all keys found across every row.

Columns

Each column is either:

setColumns(array $columns): void

Replace the column list entirely.

appendColumn(array $columns): void

Add columns to the end of the existing list.

removeColumns(array $columns): void

Remove columns by key.

tableHeadFormat(callable $callback): void

Transform every column's label (not its key) through a callback.

Cell values

columnFormat(string $key, callable $callback): void

Override the rendered value of a column for every row. The callback receives the original row (as an object) and its index.

If the callback returns HTML (e.g. a badge <span>), pair it with escapeOutput(false, 'status') below — otherwise the markup renders as literal text.

each(callable $callback): void

Iterate the raw source data, with $this (the table) passed in so the callback can configure things per row.

Output escaping

Values are HTML-escaped by default.

escapeOutput(bool $escape, string|array|null $key = null): void

Calling with no $key sets the global default and clears any earlier per-column overrides. Calling with a key (or array of keys) only touches those columns.

Only disable escaping for values you control or have already sanitized — unescaped input renders as raw HTML/JS.

HTML attributes

Attribute values passed to any of these setters are automatically escaped.

Pagination

paginate(int $perPage, ?int $page = null): void

Enable pagination. If $page is omitted, the current page is read automatically from the request's query string (?page=2 by default).

setPaginationPageName(string $name): void

Change the query string key — useful when a page has more than one paginated table.

setPaginationLabels(string $previous, string $next): void

setPaginationWindow(int $onEachSide): void

How many page numbers show on each side of the current page before collapsing into .... Default is 3, e.g. 1 ... 4 5 [6] 7 8 ... 12. Only visible once there are enough total pages to need collapsing.

setPaginationNavAttr() / setPaginationListAttr() / setPaginationLinkAttr(array $attrs): void

HTML attributes for the <nav> wrapper, the <ul>, and every <a> link.

hidePaginationControls(): void

Rows are still sliced to the current page, but the built-in Previous/Next/ number UI isn't rendered.

getPaginationMeta(): array

Returns the pagination state so you can build a fully custom UI, typically combined with hidePaginationControls().

Pagination reads/builds the query string via request(), so it requires an active HTTP request — not intended for CLI/artisan contexts.

Empty state

emptyState(string $message, array $attrs = [], bool $escape = true): void

Configure the row shown when there is no data (or the current page is empty).

Full example

Notes / gotchas

License

MIT — see LICENSE.


All versions of html-table-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/view Version ^9.0|^10.0|^11.0|^12.0|^13.0
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 ramondev/html-table-builder contains the following files

Loading the files please wait ...