Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 以110%宽度居中的表格行为中心的HTML_Php_Html - Fatal编程技术网

Php 以110%宽度居中的表格行为中心的HTML

Php 以110%宽度居中的表格行为中心的HTML,php,html,Php,Html,我在HTML电子邮件中有一个表格行,除非我将宽度设置为110%,否则无法容纳所有内容 现在唯一的问题是表向右扩展。整个桌子的宽度设置为600px 我发现,将宽度增加到110%是使手机上的文字不被包裹的唯一方法 有人能告诉我,即使这一行的宽度扩大了,如何使它居中吗 该守则是— <div style="margin-bottom: 30px; margin-top: 30px;"> <table class="td" cellspacing="0" cellpadding="6"

我在HTML电子邮件中有一个表格行,除非我将宽度设置为110%,否则无法容纳所有内容

现在唯一的问题是表向右扩展。整个桌子的宽度设置为600px

我发现,将宽度增加到110%是使手机上的文字不被包裹的唯一方法

有人能告诉我,即使这一行的宽度扩大了,如何使它居中吗

该守则是—

<div style="margin-bottom: 30px; margin-top: 30px;">

<table class="td" cellspacing="0" cellpadding="6" style="width: 110%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; border-left: none; border-right: none; border-top: 1px solid #000; border-bottom: 1px solid #000;" border="0"; align="center">
<tbody>                                         
<?php $items = $order->get_items();
foreach ($items as $item) {
$product = new WC_Product($item['product_id']);?>                                           <tr>   
<td><?php echo $product->get_image($size = 'shop_thumbnail'); ?></td>
<td><?php echo $product->get_title(); ?> </td>
<td><a href="<?php echo $url = get_permalink($product->id).'#reviews'; ?>" style="background-color: #000; color: #fff; text-decoration: none; padding: 10px;">REVIEW NOW</a></td>
</tr>
<?php                                           
}                                           
?>                                          
</tbody>                                        
</table>                                        
</div>

谢谢

附件中附有一张图片,您可以看到“立即回顾”部分延伸到上述部分。我只想把这个放在中间


您必须检查表格属性: 尝试使用“nowrap”关键字



将其添加到表格父级
左边距:-5%;保证金权利:-5%使字体大小变小。您似乎忘记添加开头标记,请提供带有desire output的输出,以便所有人都能更好地理解。抱歉,我添加了一张图片,以便您可以看到输出的样子。标签在那里。。它只是因为某种原因一直滚动到正确的位置。耶利米,我该把密码放在哪里?谢谢
<td nowrap><?php echo $product->get_image($size = 'shop_thumbnail'); ?></td>