gorilladash / outlook-formatter
扫描所有DOM并添加/替换宽度属性,确保在Outlook桌面版中表格/图片能够正常工作
v5.0.0
2022-05-07 03:55 UTC
Requires
- php: ^8.0
- illuminate/support: ^9.0
- kub-at/php-simple-html-dom-parser: ^1.9
README
扫描所有DOM并添加/替换宽度属性,确保在Outlook桌面版中表格/图片能够正常工作
仅影响Outlook桌面版
如何使用
Laravel 5.5
use OutlookFormatter; $html = ''; // your html $result = OutlookFormatter::format($html);
PHP
use GorillaDash\OutlookFormatter\Formatter; $formatter = new Formatter(800); // First argument is max width for container; $formatter->setAutoCenter(['table' => true, 'image' => true]); // Set all table/td/image to be center, default is false $html = ''; // your html $result = $formatter->format($html);