开发者

Is there a way to add a minimum height to a table?

I want to make my table to be at least 50px but st开发者_高级运维ill enlarge if there is a lot of text inside. I don't know if it makes much sense but is there a way to do it?

Thanks


Try the min-height CSS property; it was designed for this reason. Flip it into the markup to try it out, as in ;

<table style="min-height:100px;"> ... </table>

To get what you want you may need to give this property to the <td> elements, or possibly some child content of them.


A quick way to do it is to create a 50px high, 1px wide transparent GIF and then place it inside your table (perhaps in another borderless,paddless column). This will stretch the table to at least 50px, however, you will have that extra pixel to contend with. That's the only truly cross-browser way I know of.


place below code in your table tag:

style="overflow:scroll; width:680px; height: 200px;" 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜