Home >Web Front-end >HTML Tutorial >HTML table border control implementation code_HTML/Xhtml_web page production

HTML table border control implementation code_HTML/Xhtml_web page production

WBOY
WBOYOriginal
2016-05-16 16:42:351794browse

Generally when we use a table, we always give it a border attribute, such as:

, the effect is as follows:

ID NAME GENDER
1001 mike male

You can find that the border of the table seems to be very wide. Of course, the "very wide" here is definitely not the width of the table border. The width you see should be caused by the gap between . Therefore, you only need to modify the cellspacing attribute of the table, that is:

, the effect is as follows:

ID NAME GENDER
1001 mike male

However, it seems that the width is still not what we imagined: only one pixel wide. In fact, what you see in the picture above is actually two pixels wide. Why? This is because of the border between There is no overlap. Just modify the border-collapse attribute of the table,

ie

ID NAME GENDER
1001 mike male

Add a color to the table,

ID NAME GENDER
1001 mike male
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