首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Html表格中的最大高度

Html表格中的最大高度
EN

Stack Overflow用户
提问于 2013-11-30 05:19:13
回答 3查看 52.4K关注 0票数 36

我创建了一个表,我希望它是height be 800px

如果它是溢出,我想使滚动条,但标题不滚动。

所以我尝试添加这个CSS:

代码语言:javascript
复制
overflow: scroll;
max-height:800px;

但这对我不起作用。这是整个html文件。有什么问题吗?

CSS

代码语言:javascript
复制
table{
    overflow: scroll;
   text-align: center;
   margin: auto;
   max-height:800px;
}
table, td, th
{
border:1px solid green;

}
th
{
background-color:green;
color:white;
}

和HTML

代码语言:javascript
复制
<table >
  <tr>
   <th>field a</th>
   <th>field b</th>
   <th>field c</th>
   <th>field e</th>
  </tr>
  <tr>
   <td>3534534</td>
   <td>עו"ש</td>
   <td>6,463</td>
   <td>4,000</td>
  </tr>
  <tr>
   <td>3534534</td>
   <td>עו"ש</td>
   <td>6,463</td>
   <td>4,000</td>
  </tr>
</table>

谢谢!

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20293492

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档