CyberDork34
CyberDork34

Reputation: 23

How do I automatically resize the height of a table without messing up the table structure?

I exported a Website from Photoshop to Dreamweaver with the slice feature. It exports as a table. I left a section for where the content should go. I want the cell with the content to automatically resize in width depending on how much text I put inside. This is what the cell code looks like:

    <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>

This is the output:

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

The only way that I can fix the problem is if I set the cell to be the original height of the image, which defeats the purpose:

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

I don't wan't the extra space there. Also, the background-repeat tag works fine, as adding more text makes the cell longer without any deformities. Its making it smaller that kills the table. Any solutions?

Upvotes: 0

Views: 88

Answers (1)

Suman KC
Suman KC

Reputation: 3528

give table fixed width & cellpadding. also, as you are giving inline css for every p span, why not add line-height property on that long paragraph.

sorry, i didn't see your background image you're talking about.

Upvotes: 1

Related Questions