我如何在电子邮件布局laravel 5.4中显示两个表?

问题描述 投票:3回答:1

我想自定义Laravel 5.4通知电子邮件模板

https://medium.com/@adnanxteam/how-to-customize-laravel-5-4-notification-email-templates-header-and-footer-158b1c7cc1c

在vendor / mail / html / message.blade上,我尝试这样:

@component('mail::layout')
    {{-- Header --}}
    @slot('header')
        @component('mail::header', ['url' => config('app.url')])
            {{ config('app.name') }}
        @endcomponent
    @endslot

    {{-- Body --}}
    This is table one
    @component('mail::table')
    | Laravel       | Table         | Example  |
    | ------------- |:-------------:| --------:|
    | Col 2 is      | Centered      | $10      |
    | Col 3 is      | Right-Aligned | $20      |
    @endcomponent

    This is table two
    @component('mail::table')
    | Laravel       | Table         | Example  |
    | ------------- |:-------------:| --------:|
    | Col 2 is      | Centered      | $10      |
    | Col 3 is      | Right-Aligned | $20      |
    @endcomponent

    {{-- Subcopy --}}
    @isset($subcopy)
        @slot('subcopy')
            @component('mail::subcopy')
                {{ $subcopy }}
            @endcomponent
        @endslot
    @endisset

    {{-- Footer --}}
    @slot('footer')
        @component('mail::footer')
            © {{ date('Y') }} {{ config('app.name') }}. All rights reserved.
        @endcomponent
    @endslot
@endcomponent

有2张桌子。第一张表看起来不错。但是第二张桌子看起来并不整齐。似乎CSS不起作用。而且除了表1之后的数据,文字很小[]

这样的电子邮件布局结果:

enter image description here为什么会发生?我的代码仍然错误吗?

我想自定义Laravel 5.4通知电子邮件模板https://medium.com/@adnanxteam/how-to-customize-laravel-5-4-notification-email-templates-header-and-footer-158b1c7cc1c在供应商上/ mail / ...

laravel email notifications laravel-5.4
1个回答
0
投票

只需删除缩进,因为在编写Markdown电子邮件时。 Markdown解析器会将缩进的内容呈现为代码块。

© www.soinside.com 2019 - 2024. All rights reserved.