Laravel发送表格邮件模板样式

先上效果:

这里写图片描述

再上代码:

@extends('emails/master_email')
#这个就是样式,外联的样式在qq邮箱里面不能显示
<style type="text/css">
#customers
{
  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
  width:100%;
  border-collapse:collapse;
}

#customers td, #customers th
{
  font-size:1em;
  /*细线边框颜色*/
  border:1px solid #1E9FFF;
  text-align: left;
}

#customers th
{
  font-size:1.1em;
  text-align:left;
  /*表头背景颜色*/
  background-color:#1E9FFF;
  color:#ffffff;
}

#customers tr.alt td
{
  color:#000000;
  background-color:#EAF2D3;
}

</style>
@section('content')
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                {{-- 表格内容 --}}
                <div class="ibox-content">
                    <table id="customers">
                        <caption><h2 align="center" style="color: black;">{{$data->range}}注册用户信息表</h2></caption>
                        <thead>
                            <tr>
                                <th>用户名</th>
                                <th>用户类型</th>
                                <th>用户邮箱</th>
                                <th>注册时间</th>
                                <th>最近一次登陆时间</th>
                                <th>最近一次学习课程时间</th>
                                <th>最近一次学习练习时间</th>
                            </tr>
                        </thead>
                        @if (count($data))
                        {{-- @if ($data->total()>0) --}}
                        <tbody>
                            @foreach ($data as $key=>$element)
                            {{-- 这个key用来判断隔行换色 --}}
                            <tr class="{{ ($key%2==1)?'alt':'' }}">
                                <td>{{$element->user_name}}</td>
                                <td>{{$element->customer_type}}</td>
                                <td>{{$element->email}}</td>
                                <td>{{$element->create_time}}</td>
                                <td>{{$element->loginInTokens[0]->login_time or '未登录'}}</td>
                                <td>{{$element->lessonRecords[0]->update_time or '未学习'}}</td>
                                <td>{{$element->exerciseRecords[0]->update_time or '未学习'}}</td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                    @else
                    <tbody>
                        <tr ><td colspan="7"><div><h3 align="center">近一周没有注册用户,我们需要继续努力啊!</h3></div></td></tr>
                    </tbody>
                </table>
                @endif

            </div>

        </div>

    </div>
</div>
@endsection
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SHUIPING_YANG

你的鼓励是我创作的最大动力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值