Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.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/9/loops/2.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 - Fatal编程技术网

Html 固定百分比的表格单元格不';我不能处理很多项目

Html 固定百分比的表格单元格不';我不能处理很多项目,html,css,Html,Css,我有三个部门: .container(显示:表格) .left,right(显示:表格单元格) 对于.left我使用了80%,而.right使用了20%。在左分区中,我有许多具有百分比宽度的项目。如果我添加大约5个项目,一切正常,我可以调整浏览器窗口的大小,但当我有大约25个项目时,右侧消失 我没有添加html,因为它太长了。请在上查看结果。我如何解决这个问题 .container { border: 1px solid gray; display: table; wid

我有三个部门:

.container
显示:表格

.left
right
显示:表格单元格

对于
.left
我使用了80%,而
.right
使用了20%。在左分区中,我有许多具有百分比宽度的项目。如果我添加大约5个项目,一切正常,我可以调整浏览器窗口的大小,但当我有大约25个项目时,右侧消失

我没有添加html,因为它太长了。请在上查看结果。我如何解决这个问题

.container {
    border: 1px solid gray;
    display: table;
    width: 100%;
}

.left {
    display: table-cell;
    width: 80%;
    background: yellow;
}

.right {
    display: table-cell;
    width: 20%;
    background: red;
}

.items {
    width: 40%;
    height: 100px;
    background: blue;
    display: inline-block;
    margin-right: 15px;
}

.scroll {
    width: 100%;
    overflow-x: scroll;
    white-space: nowrap;
}
如果将
.container
元素更改为
fixed
,它将解决以下问题:

.container {
  border: 1px solid gray;
  display: table;
  table-layout: fixed;
  width: 100%;
}