2014-02-14 33 views
0

我使用切片功能將網站從Photoshop導出到Dreamweaver。它以表的形式出口。我留下了一段內容應該去的地方。我希望具有內容的單元格根據我放入的文本的多少自動調整寬度。這是單元代碼的樣子:如何自動調整表格的高度而不搞亂表格結構?

<td colspan="5" valign="top" style="Background-image:url('images/Content_Background.gif'); background-repeat:repeat-y;"> 

     <p>&nbsp;</p> 
     <p class="MsoNormal" align="center" style="text-align:center;"><span style="line-height:107%; font-size:28.0pt; color:white; ">Welcome!</span></p> 
     <p class="MsoNormal"><span style="line-height:107%; font-size:20.0pt; color:white; ">&nbsp;</span></p> 
     <p class="MsoNormal"><span style="font-size:20.0pt; color:white; ">        Think of a website that you love to be on. Maybe its Facebook, Twitter, Instagram, Amazon, or even Google. Ever wish you could make your own website, perhaps featuring your school work, or even just to show off to your friends? Here, you can learn how. You will learn a variety of ways to create a site, from canned templates, to Photoshop and Dreamweaver, and even starting from complete scratch. Just click Build-A-Site at the top to get started!</span></p></td> 

這是輸出:

http://postimg.org/image/6tvf7pdup/

,我可以解決這個問題的唯一方法是,如果我設置單元變爲原來的高度形象,這違背了目的的:

http://postimg.org/image/kfql2fn7r/

我不wan't多餘的空間存在。此外,背景重複標籤可以正常工作,因爲添加更多文本可以使單元更長,而不會造成任何畸形。它使它更小,殺死了桌子。任何解決方案

+0

嘗試播放列跨度屬性。如果您分享了整個表格代碼,情況會更好。 – Nix

回答

1

給出表格固定寬度& cellpadding。同樣,因爲您正在爲每個p跨度提供內聯css,爲何不在該長段中添加行高屬性。

對不起,我沒有看到你正在談論的背景圖片。

+0

我找到了解決方案。 Photoshop給了桌子一個固定的寬度,但它也給了它一個固定的高度。所以它試圖不惜一切代價保持固定高度。只需刪除表格高度標籤。不過謝謝你的幫助。 – CyberDork34