关于布局的问题 [英] Question About Layout
问题描述
对于我的在线商店,我希望在一行中显示三个项目,但由于PHP代码,我不知道如何显示它这样。目前这些项目一个接一个地显示,每行只有一个项目,这使得页面看起来有点废话。任何人都可以请帮助。我将在下面发布代码。
感谢先进。
[PHP] if(mysql_num_rows($ get_suit_res)> 0){
$ display_block ="< p>< em>对不起此Smart< / em>< / p>" ;;
while($ Suits = mysql_fetch_array($ get_suit_res)){
$ Suit_id = $套装[Suit_ID];
$ Suit_title = stripslashes($套装[Suit_Brand]);
$ Suit_price = $套装[Suit_Price];
$ Suit_Image = $套装[Suit_Image];
$ display_block。="
< table align = \" center \">
< tr>
< td>
< a href = \" showitem。 php?Suit_ID = $ Suit_id \"> $ Suit_title< / a>
< h2>£$ Suit_price< / h2>
< img src = \" $ Suit_Image\"宽度= \" 100\" height = \" 200 \">< / img>
< / td>
< / tr>
< / table>" ;;
}
$ display_block。="< ul>" ;;
}
}
}
} [/ PHP]
For my online store i would like about three items to be displayed in one row however because of the php code i wouldn''t know how to display it like this. currently the items are displayed one after the other only 1 item per row which makes the page look a bit crap. can anyone please help. i will post the code below.
thanks in advanced.
[PHP] if (mysql_num_rows ($get_suit_res) > 0 ) {
$display_block = "<p><em>Sorry no items in this Smart</em></p>";
while ($Suits = mysql_fetch_array($get_suit_res)) {
$Suit_id = $Suits[Suit_ID];
$Suit_title = stripslashes($Suits[Suit_Brand]);
$Suit_price = $Suits[Suit_Price];
$Suit_Image = $Suits[Suit_Image];
$display_block .= "
<table align=\"center\">
<tr>
<td>
<a href=\"showitem.php?Suit_ID=$Suit_id\">$Suit_title </a>
<h2>£$Suit_price</h2>
<img src=\"$Suit_Image\" width=\"100\" height=\"200\"></img>
</td>
</tr>
</table>";
}
$display_block .= "<ul>";
}
}
}
}[/PHP]
推荐答案
get_suit_res)> 0){
get_suit_res) > 0 ) {
display_block ="< p>< em>对不起此Smart< / em>< / p>";
while(
display_block = "<p><em>Sorry no items in this Smart</em></p>";
while (
Suits = mysql_fetch_array(
Suits = mysql_fetch_array(
这篇关于关于布局的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!