gorilladash/outlook-formatter

扫描所有DOM并添加/替换宽度属性,确保在Outlook桌面版中表格/图片能够正常工作

v5.0.0 2022-05-07 03:55 UTC

This package is auto-updated.

Last update: 2024-09-07 08:48:19 UTC


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);