Regarding the method of making this thin-line table, Baidu may have an answer to tell you to set these values: set border=0 cellpacing=1 bgcolor=#990033 for the table, and set the background color separately for the cell, for example: bgcolor=#fff. However, there is probably no detailed explanation on why these values are set!
So today I suddenly thought of recording the principles of this thin line table. It is also because I have been teaching students basic lessons these days. Students do not understand the principles of this thin line table very well, so if you want to beginners, you will probably encounter similar problems, so here I will talk about why these values are set.
First, let’s take a look at the effect when setting the value of the table border to 1. Even if border=1 and the distance between cells cellpacing=0, the thickness of the table still looks rough:
Let's take a look at what the effect is produced by making thin line tables:
In contrast, the tables behind are more refined.
So now I will summarize the steps for making a thin line table:
Steps to make a thin line table:
Analysis: The background color of the table is actually the thin line that looks like in the visual form, because we set the border to 0 and the spacing between cells is set to 1, then the background color of the table is the color revealed through the gap of this pixel. Set the background color of the cell to distinguish it from the background color of the table. For better understanding, I will use pictures to analyze it here:
1. Assume that the following table border=1, it is displayed as follows:
2. When cell spacing is set, cellpacing=0, two 1-pixel edges are next to each other, and the border will appear thick:
Therefore, the thin line effect cannot be set by border=1
Then we use the thin line method to make the following principle:
If this article is helpful to you, please recommend it
Original address: http://www.cnblogs.com/xcaocao/p/5643351.html