2017-07-26 50 views
0
<table> 

    <colgroup></colgroup> 
    <colgroup></colgroup> 
    <colgroup></colgroup> 
    <colgroup></colgroup> 

    <thead> 
     <tr> 
      <th>&nbsp;</th> 
      @foreach($cloud as $cu) 
      <th> 
       <h2>{{$cu->name}}</h2><br> 
       <h3 style="font-size: 35px;"><sup class="price-sign">$</sup>{{$cu->price}}<span style="font-size: large;">/{{trans('file.month')}}</span></h3> 
       <p>{{$cu->description}}</p> 
      </th> 
      @endforeach 
     </tr> 
    </thead> 

    <tfoot> 

     <tr> 
      <th>&nbsp;</th> 
      @foreach($cloud as $cu) 
      <td> 
      <a href="/deatalis/{{$cu->id}}" style="text-decoration: none;" >More Details 
      </a> 



      </td> 
      @endforeach 
     </tr> 

    </tfoot> 

    <tbody> 
     <tr> 
      <th><i class="icon-user"></i> 
      Members Number 
      <span>Cras mattis consectetur purus sit amet fermentum. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</span> 
      </th> 
      @foreach($cloud as $cu) 
      <td>{{$cu->users}}</td> 
      @endforeach 
     </tr> 
     <tr> 
      <th><i class="icon-drawer"></i> 
      Storage 
      <span>Cras mattis consectetur purus sit amet fermentum. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</span> 
      </th> 
      @foreach($cloud as $cu) 
      <td>{{$cu->space}}</td> 
      @endforeach 
     </tr> 
     <tr> 
      <th><i class="icon-layers"></i> 
      Backups 
      <span>Cras mattis consectetur purus sit amet fermentum. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</span> 
      </th> 
      @foreach($cloud as $cu) 
      <td>{{$cu->backup}}</td> 
      @endforeach 
     </tr> 

    </tbody> 

</table> 

我想使這個表格: 在這種情況下,我做foreach的每一行包括第一列標題加上每個對於同一行和每個表單相同! 當我爲所有表發送參數時,這是沒有用的!如何使用帶修正第一列的foreach製作html表格?

enter image description here

所以我想使固定的第一列,然後用一個的foreach 任何幫助它! 謝謝

回答

0

當你迭代一個數組或對象來生成一個動態表時,最好定義前面的(以靜態的方式)。

相關問題