Introduction: Web Front End | This is about how to set the HTML table fine border problem, the table border is set to a small line border generally we use the table when always give it a border attribute, such as: <tableborder= "1", the effect is as follows: Idnameg ...
This is the question of how to set the fine border of the HTML table, set the table border to a small line border
Generally we use the table when always give it a border attribute, such as: <table border= "1", the effect is as follows:
Id |
NAME |
GENDER |
1001 |
Mike |
Male |
Can find the table border seems to be very wide, of course, the "very wide" here is definitely not the width of the table border, we see the width should be between the gap between <td>. Therefore, only need to modify the table CellSpacing property, namely: <table border= "1px" cellspacing= "0px", the effect is as follows:
Id |
NAME |
GENDER |
1001 |
Mike |
Male |
However, it seems that the width is still not as we imagined: only a single pixel width, in fact, you see is actually two pixels wide, for what, this is because the border between <td> is not caused by overlap. Modify the Border-collapse property of the table,
<table border= "1px" cellspacing= "0px" style= "Border-collapse:collapse" >
Id |
NAME |
GENDER |
1001 |
Mike |
Male |
Add a color to the table, <table border= "1px" bordercolor= "#000000" cellspacing= "0px" style= "Border-collapse:collapse" >
Id |
NAME |
GENDER |
1001 |
Mike |
Male |
Set the HTML table thin border