Display: block of TR in table display layout disorder in Firefox

Source: Internet
Author: User

According to common sense, when a unit of rows needs to be displayed, use the: Display: block attribute. If no display is required, use the display: None attribute, in addition, this is normal in the IE browser, and 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 to say, no matter how small the attribute value of colspan is, 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.