/    Sign up×
Community /Pin to ProfileBookmark

Why this height property in Firefox does not work?

I put a div into a table cell, and hope it can scroll if needed:

[CODE]
<table style=”height:200px;width:200px;table-layout:fixed”>
<tr><td>
<div style=”height:100%;width:100%;overflow:auto”>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
1234567890123456789012345678901234567890<br/>
</div>
</td></tr>
</table>
[/CODE]

In IE, it works as expected. But in Firefox, only horizental scrollbar is displayed, in vertical direction, the div is expanded. the property “height=100%” has no effect.

How to solve this problem?

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@FangMar 25.2006 — This is more logical:&lt;div style="height:200px;width:200px;;overflow:auto"&gt;
Copy linkTweet thisAlerts:
@mlleeauthorMar 25.2006 — Thanks

The problem is, I cannot always suppose the table's height is 200px

In diffent context, It may be other px values, or percentage values

So I want to set the div's width and height to be 100%, so that it can change size automatically

But only width property tacks effect...
Copy linkTweet thisAlerts:
@ray326Mar 25.2006 — Maybe you need to rethink it without the table.
Copy linkTweet thisAlerts:
@felgallMar 25.2006 — A 100% high table is the default - a table high enough to display all of the content without a scrollbar.
×

Success!

Help @mllee spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,
)...