0

我正在使用 barryvdh/laravel-domPDF 并遇到了错误

在 null 上调用成员函数 get_cellmap()

我正在使用 Laravel 8.42.1 和 PHP 8.0.3。

<div>
    <div class="md:grid md:grid-cols-3 md:gap-6">
      <div class="mt-5 md:mt-0 md:col-span-2">
        <form action="#" method="POST">
          <div class="shadow sm:rounded-md sm:overflow-hidden">
            <div class="px-4 py-5 bg-white space-y-6 sm:p-6">
              <div class="grid grid-cols-2 gap-2">
                <div class="content-evenly">
                  PRIVATE AND CONFIDENTIAL
                </div>
                <div class="content-evenly col-span-1 sm:col-span-2 border-solid border-4 border-light-blue-500">
                  <div class="employee float-right m-10 text-sm font-medium text-gray-700">
                        @foreach($teams as $team)
                      <tr>
                        <th>
                          {{$team->companyName}}
                        </th><br>
                        <th>
                          {{$team->street}}
                        </th><br>
                        <th>
                          {{$team->compound}}
                        </th><br>
                        <th>
                          {{$team->suburb}}
                        </th>
                      </tr>
                      @endforeach
                      @foreach($employees as $employee)
                  </div>
                  <div class="employee float-left m-10 text-sm font-medium text-gray-700 ">
                      <tr>
                        <th>
                          {{$employee->name}} {{$employee->surname}}
                        </th><br>
                        <th>
                          {{$employee->role}}
                        </th><br>
                        <th>
                          {{$employee->idNumber}}
                        </th>
                        <th>
                          {{$employee->phone}}
                        </th>
                      </tr>
                  @endforeach
                  </div>
                </div>
              </div>           
            </form>
          </div>
        </div>
      </div> 
4

1 回答 1

0

我认为问题出在您的 html 结构上,dompdf 存在一些限制,例如不支持某些标签。我认为您应该只使用带有 thead,th,tbody,tr 的表格标签:如果您想了解更多关于限制的信息,请访问链接: https ://github.com/dompdf/dompdf#user-content-limitations-known -问题

于 2021-05-27T18:17:16.753 回答