webuni/commonmark-table-extension
最新稳定版本:v2.1.0
Composer 安装命令:
composer require webuni/commonmark-table-extension
包简介
Table extension for league/commonmark
README 文档
README
DEPRECATED
This extension has been deprecated. All of its functionality now exists in league/commonmark 1.3+ under the League\CommonMark\Extension\Table namespace, so you should upgrade to that version and use that bundled extension instead of this one.
Overview
The Table extension adds the ability to create tables in CommonMark documents.
Installation
This project can be installed via Composer:
composer require league/commonmark-ext-table Usage
Configure your Environment as usual and simply add the TableExtension provided by this package:
use League\CommonMark\Converter; use League\CommonMark\DocParser; use League\CommonMark\Environment; use League\CommonMark\HtmlRenderer; use League\CommonMark\Ext\Table\TableExtension; // Obtain a pre-configured Environment with all the standard CommonMark parsers/renderers ready-to-go $environment = Environment::createCommonMarkEnvironment(); // Add this extension $environment->addExtension(new TableExtension()); // Instantiate the converter engine and start converting some Markdown! $converter = new Converter(new DocParser($environment), new HtmlRenderer($environment)); echo $converter->convertToHtml('# Hello World!');
Syntax
This package is fully compatible with GFM-style tables:
Simple
Code:
th | th(center) | th(right) ---|:----------:|----------: td | td | td
Result:
<table> <thead> <tr> <th style="text-align: left">th</th> <th style="text-align: center">th(center)</th> <th style="text-align: right">th(right<)/th> </tr> </thead> <tbody> <tr> <td style="text-align: left">td</td> <td style="text-align: center">td</td> <td style="text-align: right">td</td> </tr> </tbody> </table>
Advanced
| header 1 | header 2 | header 2 | | :------- | :------: | -------: | | cell 1.1 | cell 1.2 | cell 1.3 | | cell 2.1 | cell 2.2 | cell 2.3 |
Table caption
header 1 | header 2 -------- | -------- cell 1.1 | cell 1.2 [Simple table]
Code:
header 1 | header 2 -------- | -------- cell 1.1 | cell 1.2 [*Prototype* table][reference_table] Result:
<table> <caption id="reference_table"><em>Prototype</em> table</caption> <thead> <tr> <th>header 1</th> <th>header 2</th> </tr> </thead> <tbody> <tr> <td>cell 1.1</td> <td>cell 1.2</td> </tr> </tbody> </table> <table>
Changelog
Please refer to the CHANGELOG for more information on what has changed recently.
Development
You need to have php or docker installed to develop the library. To list all available commands run:
./run
Security
If you discover any security related issues, please email colinodell@gmail.com instead of using the issue tracker.
Credits
License
This library is licensed under the MIT license. See the License File for more information.
webuni/commonmark-table-extension 适用场景与选型建议
webuni/commonmark-table-extension 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 948.67k 次下载、GitHub Stars 达 129, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「markdown」 「extension」 「table」 「commonmark」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 webuni/commonmark-table-extension 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 webuni/commonmark-table-extension 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 webuni/commonmark-table-extension 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Plug-ins for DataTables
A component that allows creating responsive HTML tables or lists from data object
A custom URL rule class for Yii 2 which allows to create translated URL rules
Adjacency List’ed Closure Table database design pattern implementation for Laravel. Includes restore of tree
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
统计信息
- 总下载量: 948.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 130
- 点击次数: 14
- 依赖项目数: 14
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04