PHPackages                             amercier/rectangular-mozaic - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. amercier/rectangular-mozaic

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

amercier/rectangular-mozaic
===========================

Rectangular mozaic generator library

v0.3.0(7y ago)01.4kISCPHP

Since Oct 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/amercier/rectangular-mozaic)[ Packagist](https://packagist.org/packages/amercier/rectangular-mozaic)[ RSS](/packages/amercier-rectangular-mozaic/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

rectangular-mozaic
==================

[](#rectangular-mozaic)

> Rectangular mozaic generator library for PHP.

[![Latest Stable Version](https://camo.githubusercontent.com/1805e68cdc9233d525e323bb38c290b1711e838a554da45f0459449ef4d5e70d/68747470733a2f2f706f7365722e707567782e6f72672f616d6572636965722f72656374616e67756c61722d6d6f7a6169632f762f737461626c65)](https://packagist.org/packages/amercier/rectangular-mozaic)[![Packagist](https://camo.githubusercontent.com/0b1bffe50a61a631df393664dc9b7649ef55bc5134b4059ec93e90254b58d46c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616d6572636965722f72656374616e67756c61722d6d6f7a6169632e7376673f6c6f676f3d706870)](https://packagist.org/packages/amercier/rectangular-mozaic)[![Build Status](https://camo.githubusercontent.com/dca0e8cd410dc1ead026268365dc0d17c96a6e400eb96ff9e55c3dbee69dab6f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616d6572636965722f72656374616e67756c61722d6d6f7a6169632e7376673f6c6f676f3d747261766973)](https://travis-ci.org/amercier/rectangular-mozaic)[![Code coverage](https://camo.githubusercontent.com/a757e2eec60b426e09c962f7ecc1558bb7b181e56fa126dbd8b4174002b796e3/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f616d6572636965722f72656374616e67756c61722d6d6f7a6169632e737667)](https://codecov.io/gh/amercier/rectangular-mozaic)[![Technical Debt](https://camo.githubusercontent.com/01182c19223dbb7064d99a36d14f0bdcb0f4213f42f870f0d898f32fa2eb7058/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f746563682d646562742f616d6572636965722f72656374616e67756c61722d6d6f7a6169632e737667)](https://codeclimate.com/github/amercier/rectangular-mozaic)

Description
-----------

[](#description)

Given a **number of tiles T**, and a **number of columns `Columns C`**, this library helps generating a grid of `C` columns containing `T` tiles. Each tile will either:

- occupy 1 cell, or
- span over 2 cells vertically,
- span over 2 cells horizontally.

Note: as tiles are distributed randomly, number of lines may vary from one execution to another.

Demo
----

[](#demo)

[![Example at Œco Architectes](https://camo.githubusercontent.com/8198f45232e9f6a77f41f77810d633f2b1903c0ae606e5a079389800532e8a90/68747470733a2f2f696d672e736869656c64732e696f2f776562736974652d75702d646f776e2d677265656e2d7265642f687474702f736869656c64732e696f2e7376673f6c6162656c3d77656273697465253230737461747573)](https://www.oeco-architectes.com/projets)

Example at [Œco Architectes](https://www.oeco-architectes.com/) (refresh the page to get a new layout):

[![Example at Œco Architectes](media/example-oeco.gif)](https://www.oeco-architectes.com/projets)

**Note:** all images belong to [Œco Architectes](https://www.oeco-architectes.com/).

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

[](#installation)

Install using [Composer](https://getcomposer.org/):

```
composer require amercier/rectangular-mozaic
```

Usage
-----

[](#usage)

In the following example, we will create a HTML `` element containing `20` tiles.

> **Note:** we just use a table for simplicity here. For a real website, only use `` for tabular data.

```
