Cell border width problem due to table border overlap

Source: Internet
Author: User

Accidentally took a look at someone else's CSS, in the comments, said table element border collapsed (collapsed, overlapping, that word appropriate?) ), different browsers calculate the cell border differently, and then write the link address in the note border Collapse differences in FF and Webkit; for the dead-minded technical man, do not explore the truth, still really sleep.

Angrily open the Web address (every time is very angry, often because of various reasons to open the giant slow), clear the idea, the original general meaning is said: although they deal with different, but the final presentation of the interface is the same. Then I slowly thinking, it seems that Firefox collapse in accordance with the "collapse" of the meaning of processing, webkit is in accordance with the "overlapping (or folding)" means to deal with.

In this way, the English title is very difficult to translate. How do I translate the difference between FF and WebKit when dealing with overlapping borders? Come on, WebKit is presented as overlapping, and if translated into "collapse", Firefox is presented in terms of collapse. Suddenly a phenomenon of software patents: not to protect the mind, only to protect the expression.

The CSS layout of the page is as follows:

{    table-layout: fixed;     width: 960px;     border-collapse: collapse;     border-spacing: 0;}  {    padding: 2px;     Height: 22px;     Border: 1px solid Gray;}

Then attach the simple HTML test code:

<Table>    <tbody>    <TR>        <TD>I ' m TD1</TD>        <TDID= "TD2">I ' m td2</TD>    </TR>    </tbody></Table>

Finally use getComputedStyle (td2). borderLeftWidth calculated results are really different, webkit below is 1px,firefox below is 0px, and IE can only use Td2.curretStyle.borderLeftWidth, the result is consistent with WebKit. So, it should be webkit and IE go to the same route, good base friend, must have a leg.

Trivial so much, a picture, instant seconds to understand.

--------------------------------------------

When you are bored, use code to comfort yourself;

Cell border width problem due to table border overlap

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.