PHPackages                             masterfermin02/simple-data-grid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. masterfermin02/simple-data-grid

ActiveLibrary

masterfermin02/simple-data-grid
===============================

This is my package simple-data-grid

v0.0.3(2y ago)141MITPHPPHP ^8.1

Since Jan 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/masterfermin02/simple-data-grid)[ Packagist](https://packagist.org/packages/masterfermin02/simple-data-grid)[ Docs](https://github.com/masterfermin02/simple-data-grid)[ RSS](/packages/masterfermin02-simple-data-grid/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Simple Data Grid
================

[](#simple-data-grid)

[![Latest Version on Packagist](https://camo.githubusercontent.com/df7024706c34dbff9baa692b720e866fba5ed3c19ce392ff68679ead8c9549eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61737465726665726d696e30322f73696d706c652d646174612d677269642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masterfermin02/simple-data-grid)[![Tests](https://github.com/masterfermin02/simple-data-grid/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/masterfermin02/simple-data-grid/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/6fd27ca939fcc229f12a0e896826b84bcc1c1f4aa54d6dbb9f254f53bf81856d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61737465726665726d696e30322f73696d706c652d646174612d677269642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masterfermin02/simple-data-grid)

Simple Data Grid is a PHP package that provides an easy way to generate HTML tables from arrays of data. It supports custom headers, rows, CSS classes, and table properties.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require masterfermin02/simple-data-grid
```

Usage
-----

[](#usage)

Here's a basic example of how to use the Simple Data Grid:

```
use Masterfermin02\SimpleDataGrid\SimpleGrid;

$headers = ['Name', 'Email', 'Phone'];
$rows = [
    ['John Doe', 'john@example.com', '123-456-7890'],
    ['Jane Doe', 'jane@example.com', '098-765-4321'],
];

echo SimpleGrid::fromArray($headers, $rows)->render();
```

This will generate an HTML table with the specified headers, rows, CSS class, and table properties.

Mysql Database Support
----------------------

[](#mysql-database-support)

This example assumes that you have a MySQL database running on localhost with a database named `mydatabase`, a table named `users`, and columns `id`, `name`, and `email`.

```
