小编use*_*981的帖子

为什么我的TD元素不包围文本内容?

我有一张桌子,其中左边的td占据了大部分空间,而右边的td有很小的空间迫使这些字断裂.

我试图让两个TD都与文本内容的宽度相同.我在网上做了一些研究,但没有找到解决问题的方法.

任何帮助将非常感激!下面是我的表格代码和css

CSS:

#order_info_container {
    width: 620px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
}

#customer_service {
    padding-top: 10px;
    vertical-align: top;
    text-align : right;
}

#order_information { padding-top: 20px; }

#totals_o {
    padding-top: 20px;
    text-align: right;
}
Run Code Online (Sandbox Code Playgroud)

HTML:

 <table id='order_info_container'>
  <!--This left td is taking most of the space -->
  <tr>
    <td><img id='o_summary_logo' src='o_summary_logo.png'></td>
    <!--This right td is being squished -->
    <td id='customer_service'><b>Customer Service # (646)-397-5751</b><br>
      Thank you for your business </td>

    <!--This left td is taking most of the …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
414
查看次数

为什么我的HTML源代码不能识别我的open td标签?

出于某些奇怪的原因,在我的HTML文件上查看源代码时,有一个红色的结束td标记.当我将鼠标悬停在它上面时,我收到一条通知,说"结束标记"td"看到但没有开放元素".

我的浏览器输出正常,但由于此语法问题,我的HTML未转换为PDF格式.

谁能帮我找一个解决方案?谢谢!!

    <table id='order_info_container'>
   <tr><td>
    <img id='o_summary_logo' src='o_summary_logo.png'>
    </td>

    <td id='customer_service'>
    <b>Customer Service # (212)-233-5751<br>
    Thank you for your business
    </td> //My source code is telling me that there is no open tag for this ending tag?
    </tr></table>
Run Code Online (Sandbox Code Playgroud)

html

-6
推荐指数
1
解决办法
96
查看次数

标签 统计

html ×2

css ×1