我正在使用单选按钮,当用户点击它时,表格中的一行将显示,我使用 style="display:none;" 来隐藏它,下面的代码Javascript 来显示它:
document.getElementById("testId").style.display = "inline";
问题是它的显示方式,因为我刚刚注册,所以我无法上传它的显示方式的图片,但我会尽可能多地展示它。
----------------------------------------------------------------
this is before
----------------------------------------------------------------
this is test test test test | this is the row
----------------------------------------------------------------
******************
--------------------------------------------------
this is after showing it with inline
--------------------------------------------------
this | this is the row
is |
test |
test |
test |
test |
我还注意到这种显示此行的方式只发生在 IE 以外的浏览器中! 有什么办法可以解决这个问题吗?
最佳答案
I used style="display:none;" to hide it and the code below in java script to show it
document.getElementById("testId").style.display = "inline";
inline
不是表格行的正确初始显示值 – 当然是 table-row
。
但由于旧的 IE 不能正确理解这一点,你应该将它设置为一个空字符串,
document.getElementById("testId").style.display = "";
– 这将使浏览器简单地将显示样式重置为浏览器认为是表格行的正确默认显示值。
关于html - Style.display ="inline"以不需要的方式显示表格行,有什么办法可以解决吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19652067/