douzuqin3467 2019-03-16 23:22
浏览 31

数组数据表嵌套

I already use rowspan and it does not work as I want the data is very messy they are not sorted as it is, besides I do not fit the data according to whether it is dependent on others, besides the code has a parents and their children and those children have many children but At the moment I have it show horizontal table in this way in vertical form it works well the question is to pass that data in a horizontal way in a table I show vertically the data in photo I show by colors the father is red:

colored rows

I also want to see it in a more organized way as it shows in excel:

Excel table example

@foreach ($project->administrators as $administrator)
    <p>  {{$administrator->name}}</p>
    @foreach($project->phases as $phase)            
        <p style="background: #FD2D00 !important;">{{$phase->name}}</p>

        @foreach ($phase->activities as $activity)

            @if ($activity->parent_id==null)

                <p style="background: #FDF500;">{{$activity->name}}</p>


            @endif

            @foreach($activity->activities as $especifics)

                    <p style="background: #86FD00;">{{$especifics->name}}</p>

                @foreach($especifics->products as $product)

                       <p style="background: #006BFD;">{{$product->name}}</p>

                    @foreach($product->productdetails as $productdetail)

                          <p style="background: #7243BB;">{{$productdetail->name}}</p>

                        @foreach($productdetail->evidence as $evidence )

                               <p style="background: #FF00FB;">{{$evidence->path}}</p>

                        @endforeach
                    @endforeach    
                @endforeach 
            @endforeach    
        @endforeach 
    @endforeach 

    @endforeach 
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何绘制动力学系统的相图
    • ¥15 对接wps接口实现获取元数据
    • ¥20 给自己本科IT专业毕业的妹m找个实习工作
    • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
    • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
    • ¥50 mac mini外接显示器 画质字体模糊
    • ¥15 TLS1.2协议通信解密
    • ¥40 图书信息管理系统程序编写
    • ¥20 Qcustomplot缩小曲线形状问题
    • ¥15 企业资源规划ERP沙盘模拟