Display: block of tr in table is in firefox

Source: Internet
Author: User

"

It's not a bug in the browser (or browsers) It's a bug in your code.

<Tr> elements (table rows) have a default display proterty of display:
Table-row; that is what makes them table rows.

If you apply display: block; to one then it is no longer a table row, it is
A standard block. It is as if you were to code:

<Table border = "1">
<Tr> <TD> col1 </TD> <TD> col2 </TD> </tr>
<Div> <TD colspan = "2"> This cell shocould take 2 columns
But does not because of the display: block </TD> </div>
</Table>

The reason it "appears" to work with IE is probably because IE is
Error-correcting the display property for you.

Why do you want to do this anyway? The validator wowould have told you your
Code is incorrect. Throw incorrect code at a browser and who knows what will
Happen.

 

"

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.