Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.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
Can';t使用Javascript将显示从无更改为表_Javascript_Html_Css - Fatal编程技术网

Can';t使用Javascript将显示从无更改为表

Can';t使用Javascript将显示从无更改为表,javascript,html,css,Javascript,Html,Css,所以,我有一个这样的代码 ..... table { table-layout: fixed; display: none; } ..... <body onload="readyFunc()"> ..... <script> function readyFunc() { document.getElementById("table").style.display="table"; } </script> .... 。。。。。 桌子

所以,我有一个这样的代码

.....

table {
  table-layout: fixed;
  display: none;
}

.....

<body onload="readyFunc()">

.....

<script>
function readyFunc() {
   document.getElementById("table").style.display="table";
}
</script>

....
。。。。。
桌子{
表布局:固定;
显示:无;
}
.....
.....
函数readyFunc(){
document.getElementById(“表格”).style.display=“表格”;
}
....
我试图做的是仅在加载文档时显示表。但这张桌子仍然没有显示出来

您也可以使用

例如:

document.querySelector(“表”).style.display=“表”
表{显示:无;}

你看见我了吗?

考虑改用
.display='block'
吗?你的HTML怎么样?在CSS中选择一个表标记,在JavaScript中选择一个ID。@Azametzin好的,那么如何在JavaScript中引用表标记呢?请尝试
document.querySelector(“表”).style.display=“table”
或将
id=“table”
添加到您的表格该表格是否有
id=“table”