After learning table, I will find two borders every time, which does not look pleasing to the eye. If the border is set to 0, it is not good. So how to make a table with thin borders? It is about 1px. After consulting relevant information, I found 2 ways to solve this problem, as follows:
The first method:
#message{border-collapse:collapse;border:1px solid red;} #message th,#message td{border:1px solid red;}
出生年月 | 1989年1月22号 |
---|---|
性别 | 男 |
Second method:
#message{border-spacing:1px;background:red;} #message tr{background:purple;} .......... .............. ................
The above is the detailed content of Two ways to achieve a 1px thin border using border-spacing and cellspacing in CSS. For more information, please follow other related articles on the PHP Chinese website!