0
我遇到問題。我已經嘗試過'table style ='width:200px!important;''作爲內聯,但仍然不知何故,表格的內容爲742 px 。原因可能是它的原因,因爲我們知道內聯重要覆蓋所有其他樣式。在TD我只是打印1,2,3垃圾最小值,但仍然沒有運氣。inline!重要的CSS不起作用
<strong><span><?php echo $this->__($this->getHeader()) ?></span></strong>
<?php $products = $this->getCollection(); ?>
<?php if (0 < $products->getSize()) { ?>
<table style="width:200px !important;">
<tr>
<?php
$i=0;
foreach ($products as $p) { ?>
<td style="text-align:left;">
1
</td>
<?php } ?>
</tr>
</table>
<?php } ?>
你能提供更多的代碼或小提琴嗎? –
請參閱http://sscce.org/ - 一個很好的代碼示例將是純HTML,其中最少的行數將重現該問題。它不包含任何PHP,因爲這對瀏覽器中的呈現沒有任何影響。 – Quentin
你能分享生成的html代碼嗎?有多少列? –