Home >Web Front-end >CSS Tutorial >Detailed explanation of the use of css border-collapse

Detailed explanation of the use of css border-collapse

黄舟
黄舟Original
2017-06-30 09:25:503031browse
  • Name: border-collapse
    Category: Table
    ## Brief description: Set whether the edges of rows and cells are merged
    Overview: border-collapse is to set whether there is a distance between the rows a34de1251f0d9fe1e645927f19a896e8 or b6c5a531a458a2e790c1fd6421739d1c of the table Style, the distance between a34de1251f0d9fe1e645927f19a896e8 and b6c5a531a458a2e790c1fd6421739d1c can be achieved by border="xxx" and cellspacing="xxx" in the table. In other words, when border-collapse is set to collapse, the border and cellspacingproperties of the table itself have no effect.

  • Syntax:

    Value:

    separate:Default value. Borders independent (standard HTML)

    collapse: Adjacent edges are merged

  • border-collapse : separate | collapse
Example 1:

Code:

Display effect:

    <table 
    width
    ="200" border="1" cellspacing="3" cellpadding="2" style="border-collapse:collapse">
      <tr>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
      </tr>
    </table>
Example 2:

Code:

<table width="200" border="1" cellspacing="3" cellpadding="2" style="border-collapse: separate">
  <tr>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
  </tr>
</table>

The display effect is:




The above is the detailed content of Detailed explanation of the use of css border-collapse. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn