See the following example:
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
When it is displayed in firefox, the "first line" is displayed on the last line.
So after processing the lines that need to be displayed, another function was written, first recording the lines that need to be displayed, then setting all lines to "none", and finally displaying the lines that need to be displayed in sequence. In this way, the display results of IE and firefox will be the same.
Later, I still thought this method was very stupid, so I devoted myself to researching it and found that as long as I add style="display:block" to both the second and three lines, the display will be normal. See the following code:
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
It can be seen that firefox treats whether to set style="display:block" differently, and IE has made appropriate compatibility treatments.
The conclusion and lesson is: try to use standard practices and don't expect browsers to be compatible. IE will often forget this when I use it too much.
Note: If you do not use tbody, there is no problem. But tbody can group rows, which is useful when multiple rows need to be displayed or hidden at a time.
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
When it is displayed in firefox, the "first line" is displayed on the last line.
So after processing the lines that need to be displayed, another function was written, first recording the lines that need to be displayed, then setting all lines to "none", and finally displaying the lines that need to be displayed in sequence. In this way, the display results of IE and firefox will be the same.
Later, I still thought this method was very stupid, so I devoted myself to researching it and found that as long as I add style="display:block" to both the second and three lines, the display will be normal. See the following code:
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
It can be seen that firefox treats whether to set style="display:block" differently, and IE has made appropriate compatibility treatments.
The conclusion and lesson is: try to use standard practices and don't expect browsers to be compatible. IE will often forget this when I use it too much.
Note: If you do not use tbody, there is no problem. But tbody can group rows, which is useful when multiple rows need to be displayed or hidden at a time.