删除 Virtuemart“特色产品”中的空白区域模块
我在弄清楚如何消除空白时遇到了一些麻烦。我真的不知道我做错了什么,而且我对 html 的了解不够,不知道这是否是问题所在。
附加屏幕截图:
1) 如果我保持代码不变,我的图像将与正下方的模块重叠。
2) 如果我修改代码使表格单元格高度为 400px,它会创建大量空白。
3) 如果我修改代码以使表格单元格高度为 1-399px,它会创建太多空白或重叠。
修改代码(注意:我正在使用“水平”显示样式):
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<span style="color:green"><b>> <b></span>Click here to <a href="http://localhost/joomlawebsite/index.php?option=com_content&view=article&id=52"><span style="color:blue"><b>view all featured products</b></span></a>.
</tr>
<?php
$i = 0;
while($db->next_record() ){
if ($i%2)
$sectioncolor = "sectiontableentry2";
else
$sectioncolor = "sectiontableentry1";
if( $display_style == "vertical" ) {
?>
<tr align="center" class="<?php echo $sectioncolor ?>">
<td width="<?php echo $width ?>%">
<?php
$ps_product->show_snapshot($db->f("product_sku"), $show_price, $show_addtocart);
?><br />
</td>
</tr>
<?php
}
elseif( $display_style== "horizontal" ) {
if( $i == 0 )
echo "<tr>\n";
echo "<td height=\"400px\" width=\"$width%\" align=\"center\">";
$ps_product->show_snapshot($db->f("product_sku"), $show_price, $show_addtocart);
echo "</td>\n";
if( ($i+1) == $db->num_rows() )
echo "</tr>\n";
}
elseif( $display_style== "table" ) {
if( $i == 0 )
echo "<tr>\n";
echo "<td width=\"$width%\" align=\"center\">";
$ps_product->show_snapshot($db->f("product_sku"), $show_price, $show_addtocart);
echo "</td>\n";
if ( ($i+1) % $products_per_row == 0)
echo "</tr><tr>\n";
if( ($i+1) == $max_items )
echo "</tr>\n";
}
$i++;
}?></table>
任何帮助将不胜感激。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更改位于 components/com_virtuemart/themes/"yourtemplate"/templates/common/productsnapshot.tpl.php
下
我将div样式代码更改为:
在
我将 div 样式代码更改为:
它去掉了所有不必要的空白
The change is in components/com_virtuemart/themes/"yourtemplate"/templates/common/productsnapshot.tpl.php
Under
<!-- The product name DIV. -->
I changed the div style code to this:
Under
<!-- The product image DIV. -->
I change the div style code to this:
And it took away all of the unnecessary white space