Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.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
Html 需要帮助在中心对齐我的td元素吗_Html_Css - Fatal编程技术网

Html 需要帮助在中心对齐我的td元素吗

Html 需要帮助在中心对齐我的td元素吗,html,css,Html,Css,由于某种原因,我的td元素(id='future_order')没有在中心对齐。我在网上做了很多研究,但没有找到任何有帮助的 任何帮助都将不胜感激!谢谢 css代码 #order_info_container{ width: 600px; height:100%; margin-left: auto; margin-right: auto; margin-bottom: 40px; } #order_time, #future_order{

由于某种原因,我的td元素(id='future_order')没有在中心对齐。我在网上做了很多研究,但没有找到任何有帮助的

任何帮助都将不胜感激!谢谢

css代码

#order_info_container{
    width: 600px;
    height:100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;

}



#order_time, #future_order{
    vertical-align: middle;
    text-align: center;

    font-size: 28px;
    font-weight: bold;
    padding-top: 30px;


}
<table id="order_info_container">
  <tbody>
  <tr>
  <td>
<img id="o_summary_logo" src="o_summary_logo,png">
  </td>
<td id="customer_service">
<b>
Customer Service # (212)-283-5751
<br>
Thank you for Business!
</b>
</td>
</tr>
<tr>
<td id="future_order">****FUTURE ORDER****</td> <!-- This is not aligning in the middle -->
</tr>
</tbody>
</table>
Html代码

#order_info_container{
    width: 600px;
    height:100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;

}



#order_time, #future_order{
    vertical-align: middle;
    text-align: center;

    font-size: 28px;
    font-weight: bold;
    padding-top: 30px;


}
<table id="order_info_container">
  <tbody>
  <tr>
  <td>
<img id="o_summary_logo" src="o_summary_logo,png">
  </td>
<td id="customer_service">
<b>
Customer Service # (212)-283-5751
<br>
Thank you for Business!
</b>
</td>
</tr>
<tr>
<td id="future_order">****FUTURE ORDER****</td> <!-- This is not aligning in the middle -->
</tr>
</tbody>
</table>

客户服务#(212)-283-5751

谢谢你的生意! ****未来订单****
更改:

<td id="future_order">****FUTURE ORDER****</td>
****未来订单****
致:

****未来订单****

在要居中的td处使用colspan=“2”,否则它将在该单元格中居中,而不会在整行居中

<td colspan="2" id="future_order">text</td>
文本

jsFiddle:

只需添加啊好的,现在我明白了。非常感谢你的帮助!