html table 高度 100,HTML設置表高度為100%

I’ve tried doing this, but it seems to just be ignored. I found a few articles saying that if you wanted to do this then you had to make sure that the parent object was also 100%. I have the following:

我試過這樣做,但似乎只是被忽略了。我發現有一些文章說如果你想這樣做,那么你必須確保父對象也是100%。我有以下內容:

Untitled Page

.MasterStyle

{

width: 98%;

height: 100%;

}

.ContentStyle

{

width: 100%;

}

.TableStyle

{

width: 133px;

height: 100%;

}

Style="text-align:right" Width="100%" />


I have a border around the table and can see that it’s not filling the height. Can anyone tell me why I’m not getting 100% height?

我在桌子周圍有一個邊框,可以看到它沒有填滿高度。誰能告訴我為什么我沒有達到100%的高度?

2 个解决方案

#1

6

I believe this is also browser dependant, the implementations vary a little bit...

But try setting to a height of 100 % as well, since it is the element surrounding

. The hierarchy is html > body > table, if the outermost element is not set to 100%, the inner ones can not get any bigger.

我相信這也是依賴於瀏覽器的,實現方式有所不同......但是嘗試將設置為100%的高度,因為它是圍繞的元素。層次結構是html> body> table,如果最外層元素未設置為100%,則內部元素不能更大。

Edit:

Looking closer at your source code, I believe that your table is actually sitting at html > body > form > table, so maybe you nee to set the form height to 100 %, too. And I noticed that your

is set to 100 %, better remove that, since is not part of the hierarchy of your table. You never how setting a height for might confuse a rendering engine...

編輯:仔細看看你的源代碼,我相信你的表實際上是坐在html> body> form> table,所以也許你需要將表單高度設置為100%。我注意到你的設置為100%,最好刪除它,因為不是表格層次結構的一部分。你永遠不會如何設置的高度可能會混淆渲染引擎......

#2

2

看看這個網站,希望它有所幫助:http://apptools.com/examples/tableheight.php

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值