Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 表中的静态标题和第一列_Html_Css_Responsive Design - Fatal编程技术网

Html 表中的静态标题和第一列

Html 表中的静态标题和第一列,html,css,responsive-design,Html,Css,Responsive Design,我有一个很大的表,当滚动标题和行中的第一列时,它是静态的,不应该移动。我只想用CSS解决这个问题。问题是,表格单元格是动态的,所以您不知道宽度/高度是多少 <table> <thead> <tr> <th>First</th> <th>Second</th> … </tr> </thead>

我有一个很大的表,当滚动标题和行中的第一列时,它是静态的,不应该移动。我只想用CSS解决这个问题。问题是,表格单元格是动态的,所以您不知道宽度/高度是多少

<table>
   <thead>
        <tr>
        <th>First</th>
        <th>Second</th>
        …
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class=”static”>First</td>
            <td class=”static”>Second</td>
            <td>4</td>
            <td>5</td>
            <td>6</td>
            <td>7</td>
        …
        </tr>
        ….
    </tbody>
</table>

弗斯特
第二
…
弗斯特
第二
4
5
6
7
…
….

这里有一个例子:可能是你想要的,它不会工作,因为表格可以水平和垂直滚动,这里的绝对位置弄乱了标题,并且没有正确溢出。我打开了一些插件,它们只做这两件事。性能在这里非常重要。