CSS border-collapse property
The function of the CSS border-collapse property is to merge the borders of the table fields to make the table more beautified. Web designers often use the separate or collapse property values of the border-collapse property to increase or increase the border distance of the table fields. It is merged together, border-collapse is often designed with border-spacing attribute to replace the cellspacing function of traditional HTML table , and obtain more expanded design space. Almost all mainstream browsers support the effect of CSS border-collapse attribute . CSS border-collapse property syntax
- border-collapse:separate; //The default value, the borders are separated from each other
- border-collapse:collapse; //The border is merged into a single border
- border-collapse:inherit; //Inherited from the border-collapse property value of the parent layer.
CSS border-collapse property example 1. Use the property value separate
<!--
table{
border-collapse:separate;
collapse;border:1px solid black;
}
td{
collapse;border:1px solid black;
}
-->
</style>
< table>
<tr><td>The table after using border-collapse</td><td>The table after using border-collapse</td></tr>
<tr><td>The table after using border-collapse </td><td>The table after border-collapse</td></tr>
</table>
Table after using border-collapse | Table after using border-collapse |
Table after using border-collapse | Table after using border-collapse |
CSS border-collapse property example two, use the property value to collapse
<!--
table{
border-collapse:collapse;
border:1px solid black;
}
td{
border:1px solid black;
}
-->
</style>
<table>
<tr ><td>The table after using border-collapse</td><td>The table after using border-collapse</td></tr>
<tr><td>The table after using border-collapse</td> <td>The table after border-collapse</td></tr>
</table>
Table after using border-collapse | Table after using border-collapse |
Table after using border-collapse | Table after using border-collapse |
- HTML Table
- CSS border
Post a Comment
0 Comments