【问题标题】:equal table border height for all columns所有列的相同表格边框高度
【发布时间】:2012-12-08 20:14:15
【问题描述】:

我连续有 3 列,我当前的输出是

我需要的输出是 ![需要的输出][2]

![cur o/p][2]

【问题讨论】:

标签: html css html-table


【解决方案1】:

文本之间有 4 个
标签

Lorem Ipsum<br><br><br><br> passages, <br><br><br><br>and more recently

删除它们。

【讨论】:

  • 实际上我需要显示我的输出,因为我正在使用那个
    ..在我的原始页面中......即使这些行没有
    跨度>
  • 你能在没有
    的情况下发布带有该输出的 js fiddle 吗?
  • 我以前的小提琴是.. jsfiddle.net/6XsKj/1 并且在使用 table{ height:100%} 后,我得到的输出为jsfiddle.net/6XsKj/8,但我需要的输出是.. jsfiddle.net/6XsKj/12跨度>
【解决方案2】:

使用colspan 属性指定每列占用多少空间。另外,使用&lt;style&gt;标签为元素设置css,而不是把它们放在内联,这样会使网站混乱。

HTML+CSS:

<table width="100%" border="1" padding="2" style="font-size:18px;">

<tbody>

<tr height="46" colspan="3">
<td width="30%">&nbsp;Marks and Number of packages</td>
<td width="50%">&nbsp;Proper Description of goods</td>
<td width="20%">&nbsp;Net quantity per &nbsp;package</td>
</tr>

<tr class="tableContent">
<td colspan="1" valign="top">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type </td>
<td colspan="1" valign="top">Lorem Ipsum<br> passages, <br>and more recently</td>
<td colspan="1" valign="top">sit amet,<br> consectetur<br> adipisicing elit, <br>sed do eiusmod tempor</td>
</tr>

<tr>
<td height="50" valign="top" colspan="1">&nbsp;Name and Address of Shipper</td>
<td valign="top" colspan="2">&nbsp;Signature & Date</td>
</tr>

</tbody>

</table>
​
<style type="text/css">
.tableContent td, td{
padding-left:10px;
}
</style>
​

演示:http://jsfiddle.net/Csr6X/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-19
    • 1970-01-01
    • 2015-03-19
    • 1970-01-01
    相关资源
    最近更新 更多