Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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,我试过了 <table border="0" cellspacing="0" cellpadding="0" height="25" width="100%" style='table-layout:fixed' > 及 您需要指定两个属性,表布局:固定在表上,空白:nowrap;在牢房里。您还需要移动溢出:隐藏;也去牢房 table {width:100%; table-layout:fixed;} td {overflow:hidden; white-space:now

我试过了

<table border="0" cellspacing="0" 
 cellpadding="0" height="25" width="100%" style='table-layout:fixed' >


您需要指定两个属性,表布局:固定在表上,空白:nowrap;在牢房里。您还需要移动溢出:隐藏;也去牢房

table {width:100%; table-layout:fixed;}
td {overflow:hidden; white-space:nowrap;}

您可以使用
overflow-x:hidden
仅在文本溢出时水平隐藏文本。类似地
overflow-y:hidden
隐藏垂直滚动条。请记住,还要将
表格布局设置为
固定
,将
空白设置为
不换行

我的代码是一个JSP页面,当我尝试“表格布局”和“溢出-x”时,它会显示未定义的属性名称。你能发布完整的相关代码吗?可能是其他地方的问题。
table {width:100%; table-layout:fixed;}
td {overflow:hidden; white-space:nowrap;}