【发布时间】:2018-12-05 19:36:20
【问题描述】:
我正在尝试将数据库中的数据提取到 Materialise CSS 卡中。我想要的是一排只有3张牌。在一行中的第三张牌之后,它应该在下一个新行中自动显示接下来的 3 张牌。
And this is how I want to display it 这是我的快照代码。
<?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>";
?>
【问题讨论】:
-
那么你有没有尝试过真正做你想做的事?
-
我发的都是我做的。
-
我理解,但它确实没有尝试实现“一行只有3张卡片。在一行第三张卡片之后,它应该在下一个新行中显示接下来的3张卡片”。没有进一步的观察,不清楚是什么部分导致了您的问题。
-
我添加了另一个快照,以便更清楚地了解我想要如何显示它。
标签: php html css mysql materialize