【发布时间】:2010-05-26 12:59:35
【问题描述】:
我正在尝试将表格列的宽度设置为最小值。标题行 (th) 设置为 white-space:nowrap 以防止换行。现在所有列(包括 td 行)都设置为 th 的宽度。我试图通过在 html 中将其设置为 <th style="width:200px;"> and <td style="width:200px;"> 来扩大较小列的大小,但它没有效果。在firebug中,在样式部分,宽度设置是活动的
element.style {
width:200px;
}
不过,计算出来的标签显示宽度小于 200 像素。请参阅下面的详细信息。
th -- 计算:
Text
font-family verdana,arial,helvetica,sans-serif
font-size 10px
font-weight bold
font-style normal
color #333333
text-transform none
text-decoration none
letter-spacing normal
word-spacing 0
line-height 17px
text-align left
vertical-align baseline
direction ltr
Background
background-color transparent
background-image none
background-repeat repeat
background-position 0 0
background-attachment scroll
opacity 1
Box Model
width 152px
height 17px
top auto
right auto
bottom auto
left auto
margin-top 0
margin-right 0
margin-bottom 0
margin-left 0
padding-top 0
padding-right 0
padding-bottom 0
padding-left 0
border-top-width 0
border-right-width 0
border-bottom-width 0
border-left-width 0
border-top-color #333333
border-right-color #333333
border-bottom-color #333333
border-left-color #333333
border-top-style none
border-right-style none
border-bottom-style none
border-left-style none
Layout
position static
display block
visibility visible
z-index auto
overflow-x visible
overflow-y visible
white-space nowrap
clip auto
float none
clear none
-moz-box-sizing content-box
Other
cursor pointer
list-style-image none
list-style-position outside
list-style-type disc
marker-offset auto
和 td --computed:
Text
font-family verdana,arial,helvetica,sans-serif
font-size 11px
font-weight 400
font-style normal
color #222222
text-transform none
text-decoration none
letter-spacing normal
word-spacing 0
line-height 12px
text-align left
vertical-align top
direction ltr
Background
background-color transparent
background-image none
background-repeat repeat
background-position 0 0
background-attachment scroll
opacity 1
Box Model
width 152px
height 48px
top auto
right auto
bottom auto
left auto
margin-top 0
margin-right 0
margin-bottom 0
margin-left 0
padding-top 5px
padding-right 6px
padding-bottom 5px
padding-left 6px
border-top-width 0
border-right-width 1px
border-bottom-width 0
border-left-width 0
border-top-color #222222
border-right-color #222222
border-bottom-color #222222
border-left-color #DDDDDD
border-top-style none
border-right-style none
border-bottom-style none
border-left-style solid
Layout
position static
display table-cell
visibility visible
z-index auto
overflow-x visible
overflow-y visible
white-space normal
clip auto
float none
clear none
-moz-box-sizing content-box
Other
cursor auto
list-style-image none
list-style-position outside
list-style-type disc
marker-offset auto
任何帮助,非常感谢...谢谢
【问题讨论】:
标签: css