{"id":21688471,"url":"https://github.com/lib16/html-builder-php","last_synced_at":"2026-05-17T22:35:49.558Z","repository":{"id":57014560,"uuid":"324810114","full_name":"lib16/html-builder-php","owner":"lib16","description":"lib16 RSS Builder is a PHP 8 library for creating HTML5 documents.","archived":false,"fork":false,"pushed_at":"2021-01-01T17:58:16.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T12:38:32.059Z","etag":null,"topics":["builder","html","html5","php","php8","table","writer"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lib16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-27T17:10:54.000Z","updated_at":"2021-01-01T17:58:18.000Z","dependencies_parsed_at":"2022-08-21T13:30:10.532Z","dependency_job_id":null,"html_url":"https://github.com/lib16/html-builder-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lib16/html-builder-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib16%2Fhtml-builder-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib16%2Fhtml-builder-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib16%2Fhtml-builder-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib16%2Fhtml-builder-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lib16","download_url":"https://codeload.github.com/lib16/html-builder-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lib16%2Fhtml-builder-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33157699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["builder","html","html5","php","php8","table","writer"],"created_at":"2024-11-25T17:15:21.386Z","updated_at":"2026-05-17T22:35:49.537Z","avatar_url":"https://github.com/lib16.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lib16 HTML Builder for PHP 8\nA library for creating HTML5 written in PHP 8.\n\n[![Build Status](https://travis-ci.com/lib16/html-builder-php.svg?branch=main)](https://travis-ci.com/lib16/html-builder-php)\n[![Coverage](https://codecov.io/gh/lib16/html-builder-php/branch/main/graph/badge.svg)](https://codecov.io/gh/lib16/html-builder-php)\n\n## Installation with Composer\nThis package is available on [packagist](https://packagist.org/packages/lib16/html),\ntherefore you can use [Composer](https://getcomposer.org) to install it.\nRun the following command in your shell:\n\n```\ncomposer require lib16/html dev-main\n```\n\n## Basic Usage\n\nBuild your tables with this library:\n\n``` php\n\u003c?php\nrequire_once 'vendor/autoload.php';\n\nuse Lib16\\HTML\\Table;\n\n$data = [\n    ['model' =\u003e 'Panther', 'city' =\u003e 'Berlin', 'quantity/store' =\u003e 20],\n    ['model' =\u003e 'Panther', 'city' =\u003e 'Berlin', 'quantity/store' =\u003e 12],\n    ['model' =\u003e 'Panther', 'city' =\u003e 'Cologne', 'quantity/store' =\u003e 12],\n    ['model' =\u003e 'Lion', 'city' =\u003e 'Cologne', 'quantity/store' =\u003e 12],\n    ['model' =\u003e 'Lion', 'city' =\u003e 'Hamburg', 'quantity/store' =\u003e 15],\n    ['model' =\u003e 'Lion', 'city' =\u003e 'Hamburg', 'quantity/store' =\u003e 15],\n    ['model' =\u003e 'Lion', 'city' =\u003e 'Munich', 'quantity/store' =\u003e 15],\n];\n$table = Table::create('Availability')-\u003esetClass('t1');\n$table-\u003ethead()-\u003etr()-\u003ethn('model', 'city', 'quantity/store');\n$table-\u003ebodies($data);\nprint $table;\n\n// change order\n$keys = ['city', 'model', 'quantity/store'];\n$table = Table::create('Availability')-\u003esetClass('t1');\n$table-\u003ethead()-\u003etr()-\u003eheaderCells($keys);\n$table-\u003ebodies($data, ...$keys);\nprint $table;\n\n// row by row\n$table = Table::create('Availability')-\u003esetClass('t2');\n$table-\u003ethead()-\u003etr()-\u003ethn('model', 'city', 'quantity/store');\nforeach ($data as $row) {\n    $table-\u003etr()-\u003edataCells($row);\n}\nprint $table;\n\n?\u003e\n\u003cstyle\u003e\nbody, * {\n    font-family: source serif pro, serif;\n}\ncaption, th {\n    font-family: source sans pro, sans-serif;\n}\ncaption {\n    margin: 0.5em;\n}\ntd, th {\n    text-align: left;\n    vertical-align: text-top;\n    padding: 0.5em;\n    border: 1px solid rgb(0, 51, 102);\n}\ntd:last-child {\n    text-align: right;\n}\nth {\n    color: white;\n    background-color: rgba(0, 51, 102, 1);\n    font-weight: normal;\n}\n.t1 tbody,\n.t2 tr {\n    background-color: rgba(51, 102, 0, 0.2);\n}\n.t1 tbody:nth-child(2n),\n.t2 tr:nth-child(2n) {\n    background-color: rgba(52, 102, 0, 0.3);\n}\ntable {\n    border-collapse: collapse;\n    margin: 2em;\n    float: left;\n}\n\u003c/style\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flib16%2Fhtml-builder-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flib16%2Fhtml-builder-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flib16%2Fhtml-builder-php/lists"}