From: http://blog.sina.com.cn/s/blog_5b6c4f550100yk4x.html
Recently, when I was working on a project, I encountered a problem, that is, Ajax was needed to display the content in the <tr> </tr> tag interactively. According to common sense, when a line needs to be displayed, use the: Display: block attribute. The display: None attribute is used when no display is required, and the display is normal in IE browser, so there is no problem.
However, when using Firefox for browsing, there was a layout disorder. Then, through firebug, I went to view the source code, debugged it, and found that it was a ghost of the display: block attribute.
1. When a table contains multiple columns, the content width of the row whose attribute is "display: Block" is only the same as that of the first column, that is, no matter how many attribute values you set for colspan, the space of the remaining columns is not parsed.
2. The same row is repeatedly switched between "display: none;" and "display: block, at the bottom of the table, excessive spaces are generated continuously, resulting in page layout distortion.
Solution:
1. Use the display: Table-row attribute for debugging. The discoverer is normal in Firefox, but IE does not support Attribute Modification. What should I do? Use Js for judgment, and then make compatibility.
2. Another simple and feasible method is to use the display: ''attribute dispaly without adding anything. It is strange that it is compatible with Firefox and IE. The specific cause is to be analyzed by the cool.
PS: Each HTML tag has its own default display attribute. When you set display to null, the browser should set the element to the default attribute, therefore, it is compatible with all browsers, which is no choice but a choice!