【发布时间】:2014-04-21 04:32:00
【问题描述】:
我的 Laravel 的 Blade 视图中有这段代码:
@foreach ($questions as $question)
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
@if(isset($question->task))
<a href="{{URL::action('showTask', $question->task_id)}}"><h4> <span class='glyphicon glyphicon-file'></span> {{$question->Task->name}}</h4></a>
@endif
<blockquote >
<a class="nostyle" href="{{URL::action('showQuestion',$question->id)}}" ><p
@if($question->status==1)
class="text-success"
@endif
>{{$question->text}}</p></a>
<footer>Gevraagd door <strong>{{$question->Author->getFullName('mij') }}</strong> op <strong>{{DateConverter::dateToString($question->created_at)}}</strong></footer>
@if($question->status==1)
<span class="label label-success">Beantwoord</span>
@endif
</blockquote>
</div>
@endforeach
显示所有问题。我希望它们以漂亮的 3 行 显示。但是,某些文本 ($question->text) 比其他文本长,因此它们不会总是完美地开始新行,而是附加到最短的先前网格,如您在屏幕截图中所见.
我想要的更像是一个表格,三列,然后是相同高度的新行,包含三个新项目。
所以我正在寻找一种方法
-
要么将所有列返回相同的高度
-
或在每三列之后自动添加和关闭一个行 div。
最好的方法是什么?
【问题讨论】:
标签: css laravel twitter-bootstrap grid laravel-blade