drb88830 2018-12-05 19:36
浏览 65

当这些卡保存从mysql数据库获取的数据时,如何连续排列实现css卡

I am trying to fetch data from database into Materialize CSS cards. What I want is only 3 cards in one row. After 3rd card in one row, it should display next 3 cards in next new row automatically.

Here is the snapshot of how it is getting displayed now. And this is how I want to display it And here is my code for that snapshot.

<?php
        $cnt=1;
        $sql=mysqli_query($db,"select * from addevent");
        $row=mysqli_num_rows($sql);

        while($row=mysqli_fetch_array($sql)){
                echo"<div class='card amber lighten-1' style='grid-auto-flow:row; width:300px;margin-left:10px;'>
                                <div class='card-content'>";
                                    echo "<span class='card-title activator teal-text text-darken-3'>".$row['EventName']."<i class='material-icons right'>more_vert</i></span>";
                                    echo "<h6 class='teal-text text-darken-3'>".$row['Oname']."</h6>";
                                    echo "<h5 class='brown-text text-lighten-3'>".$row['EventDate']." | ".$row['EventTime']."</h5>";
                                    echo "<p class='deep-orange-text text-lighten-1'>".$row['EventAddress']."</p>";
                                echo"</div>";

                                echo"<div class='card-reveal'>";
                                    echo "<span class='card-title orange-text text-lighten-1'>".$row['EventName']."<i class='material-icons right'>close</i></span>";
                                    echo "<p class='teal-text text-lighten-2'>".$row['AboutEvent']."</p>";
                                echo"</div>";
                        echo"</div>";

            }
            echo"</div>";
    ?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号