CSS alternative syntax for HTML Table cellspacing
The CSS alternative syntax of HTML Table cellspacing can be achieved with the border-spacing attribute. The so-called border-spacing attribute refers to the "border space", which can achieve the same effect as the cellspacing attribute of the traditional HTML table , and it can further The horizontal and vertical distances between the table fields are designed separately. To design table fields with the same horizontal or vertical distance , you can directly use the border-spacing attribute or the traditional HTML cellspacing attribute. field vertical space frame design is different, you must use CSS 's border-spacing and border-collapse property together with the use of examples of these two effects will make the difference. CSS border-spacing property syntax
- CSS border-spacing property
Example of CSS alternative syntax for HTML Table cellspacing 1. Original cellspacing effect
<tr><td>Use the fields after cellspacing</td><td>Use the fields after cellspacing</td></tr>
<tr>< td>Use the fields after cellspacing</td><td>Use the fields after cellspacing</td></tr>
</table>
Field after using cellspacing | Field after using cellspacing |
Field after using cellspacing | Field after using cellspacing |
- HTML table cellspacing attribute
Example of CSS alternative syntax for HTML Table cellspacing 2. Switch to CSS border-spacing effect
<tr><td>The field after using border-spacing</td><td>The field after using border-spacing</td ></tr>
<tr><td>Use the field after border-spacing</td><td>Use the field after border-spacing</td></tr>
</table>
Fields after using border-spacing | Fields after using border-spacing |
Fields after using border-spacing | Fields after using border-spacing |
Example of CSS alternative syntax of HTML Table cellspacing 3. The horizontal and vertical distances of the fields are different
<tr><td>Fields after using border-spacing</td><td>Use border-spacing The field after the </td></tr>
<tr><td>The field after the use of border-spacing</td><td>The field after the use of border-spacing</td></tr>
< /table>
Fields after using border-spacing | Fields after using border-spacing |
Fields after using border-spacing | Fields after using border-spacing |
➤Learn the distance between the table fields, what about the distance inside the table? Read this article: CSS alternative syntax for HTML Table cellpadding .
Post a Comment
0 Comments