html - 带有表格标题的不可滚动的 HTML 内容

标签 html css

我想要一个 html 页面,它有一个 html 标题和一个具有不可滚动功能的表标题。只有表格内容应该是可滚动的。

例如:

<html>
    <body>
        <h1>header</h1>
        <h1>header2</h1>
        <table>
            <thead>
                <tr>
                    <th>name</th>
                </tr>
                <tr>
                    <th>address</th>
                </tr>
            </thead>

            <tbody>
                <tr>
                    <td>Venkat</td>
                </tr>
                <tr>
                    <td>bangalore</td>
                </tr>
                //this part will be repeating
            </tbody>
        </table>
    </body>
</html>

我只希望表体中的内容可以滚动。

我也提到了以下链接 How do you create non scrolling div at the top of an HTML page without two sets of scroll bars

但我不能使用 div 只包含标题和表头..

我创建了一个与我的情况类似的 fiddle 。请看http://jsfiddle.net/VenkateshManohar/bU7NN/

最佳答案

你会找到一个 jQuery 插件 here那会为你做的;)

关于html - 带有表格标题的不可滚动的 HTML 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22834192/

相关文章:

javascript - 难以在每个新 <div> 中添加新表单

html - 黑莓网站:支持HTML5

javascript - svg 中的 <button> 元素?

javascript - 奇怪的 HTML/JS/CSS 滚动条功能难题

html - Chrome 和 Safari 绝对 Div 显示问题

html - 视网膜显示如何与我的 css 和 psd 相关

javascript - 我如何使用事件目标属性访问 <li> 元素中的特定值?

jquery - 有什么方法可以支持 bootstrap 工具提示中的 HTML 标签代码吗?

android - 为什么不使用 PT 作为字体和元素大小的单位?

使用 :checked pseudo class 检查特定单选按钮时 CSS 更改