PDF dom列并排没有显示正确的Laravel

时间:2018-09-05 18:44:24

标签: php html css laravel

您好,我在laravel上使用Pdf dom,并且我需要并排排列的列 我已经尝试过了:

<style>
* {
    box-sizing: border-box;
}

/* Create two equal columns that floats next to each other */
.column {
    float: left;
    width: 50%;
    padding: 10px;
    height: 300px; /* Should be removed. Only for demonstration */
}

/* Clear floats after the columns */
.row:after {
    content: "";
    display: table;
    clear: both;
}
</style>
<br>

<table>

    @php ($i = count($question->answers))
    @foreach($question->answers as $key => $answer)


    @if($i % 2 != 0)            
    <div class="row">
        @endif
        @if($answer->is_key == 0)

        <div class="column" style="background-color:#aaa;">
            <h2>Column  left {{$i}}</h2>
            <p>Some text..</p>
        </div>
        @endif
        @if($answer->is_key == 1)
        <div class="column" style="background-color:#bbb;">
             <h2>Column right {{$i}}</h2>
            <p>Some text..</p>
        </div>
        @endif

    </div>      
    @php ($i--)
    @endforeach
</table>

嗨,我尝试了这个,结果是这样的: enter image description here

能否请你帮我..?我怎样才能使第一个像其他人一样在线

0 个答案:

没有答案