2016-11-22 14:58
浏览 93


I'm trying to export a table in PDF, but I have a foreach and I want to export all data from foreach, but is not working for all, just for a row.

Here is the code:

foreach ($posts as $post) {
    $html = '<div class="table-scrollable">
                    <table id="posts" class="table table-bordered table-hover">
                        <tbody id="body"><tr>
            . $post->id . ' 
                            <td>' .
            $post->name .
            . $post->title .
return PDF::load($html, 'A4', 'portrait')->download('my_pdf');
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题