所有列的表边界高度相等

时间:2012-12-08 09:12:19

标签: html css html-table

我连续3列,当前输出为Current output

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

![cur o / p] [2]

needed

2 个答案:

答案 0 :(得分:0)

文本之间有4个标签

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

删除它们。

答案 1 :(得分:0)

使用colspan属性指定每列占用的空间大小。另外,使用<style>标记为元素设置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>
​

DEMO:http://jsfiddle.net/Csr6X/