2015-07-22 55 views
0

我有一個td元素中的textarea作爲描述字段,如下圖所示。 enter image description here調整表格中的textarea影響其他TR的邊距

當我調整textarea的垂直,它工作得很好enter image description here

但是......

enter image description here

當我調整textarea的到原來的高度,它會影響其他TD就像它在第三張圖片中顯示的那樣。

我想讓它防止發生。

注意:它只發生在Chrome中,Firefox可以處理這個問題。

編輯:

Here is the fiddle link. 

http://jsfiddle.net/kvKZu/42/

+1

做小提琴。 – Govan

+0

在這裏或在小提琴中添加您的網站代碼 –

+0

這種佈局更適合使用div。表格用於數據表示。 –

回答

1

變化height:100%height:autoimg標籤

<tr> 
<td rowspan="6" style="width:200px;"> <image scr="#" style="width:100%; height:auto;" ></image> </td> 
</tr> 

小提琴:http://jsfiddle.net/kvKZu/48/

+0

正確的解決方案。或者,你可以給TD元素一個固定的高度,即使1px可以工作,因爲內容根據需要擴展高度。 – initall

+0

雅你是對的@initall –