kennysoft/parsedown-tablespan

An extension of ParsedownExtra that adds support for rowspan and colspan.

v1.1.0 2022-02-13 06:37 UTC

This package is auto-updated.

Last update: 2024-04-13 12:59:13 UTC


README

An extension of ParsedownExtra and Parsedown that adds support for rowspan and colspan.

Also, ParsedownExtended 1.1+ provides in the same way.

Installation

Composer

Install the composer package by running the following command:

composer require kennysoft/parsedown-tablespan

Manual

  1. Download the "Source code" from the latest release
  2. Include Parsedown.php, ParsedownExtra.php, and ParsedownTablespan.php

Example

$ParsedownTablespan = new ParsedownTablespan();

echo $ParsedownTablespan->text('
| >     | >           |   Colspan    | >           | for thead |
| ----- | :---------: | -----------: | ----------- | --------- |
| Lorem | ipsum       |    dolor     | sit         | amet      |
| ^     | -           |      >       | right align | .         |
| ,     | >           | center align | >           | 2x2 cell  |
| >     | another 2x2 |      +       | >           | ^         |
| >     | ^           |              |             | !         |
');

Prints:

Colspan for thead
Lorem ipsum dolor sit amet
- right align .
, center align 2x2 cell
another 2x2 +
!

(Since GitHub does not accept style attribute for cells, upper table is made with align attribute which is not supported in HTML5, just to show what will be generated.)

License

Author

KENNYSOFT hyeonmin.park@kennysoft.kr