php - How to make html table using foreach with fix first column? -
<table> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <thead> <tr> <th> </th> @foreach($cloud $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> </th> @foreach($cloud $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 $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 $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 $cu) <td>{{$cu->backup}}</td> @endforeach </tr> </tbody> </table>
i want make table : in case, make foreach every row include first column title plus each same row , same every form! not useful when make form table send parameter!
so want make first column fixed , make 1 foreach help! thanks
when iterating through array or object generate dynamic table, it's better define theads ahead(in static way).
Comments
Post a Comment