Home >Web Front-end >HTML Tutorial >When the data in the table is empty, the border of td is not displayed? _html/css_WEB-ITnose
In addition to adding spaces, can you use css style control?
You can write CSS .td {solid 10px red} Like this. .
FF right?
Are the width and height given? It seems that I have encountered it at that time. Didn't think of a better way.
The method on the first floor doesn’t work. .
Baidu can do it
Just add .
Just put a space in it and that should solve the problem. . .
This problem seems to only exist in FireFox. The easiest way is to add a space in it.
I’ve tried everything else but haven’t been able to get it right.
<!doctype html><html> <head> <meta charset="gb2312" /> <title></title> <style> table{ border-collapse:collapse;} td{ width:100px; height:40px; padding:10px; border:1px solid red; text-align:center;} </style> </head> <body> <table> <thead> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> </thead> <tbody> <tr> <td>1-1</td> <td>1-2</td> <td>1-3</td> </tr> <tr> <td>2-1</td> <td>2-2</td> <td>2-3</td> </tr> <tr> <td></td> <td>3-2</td> <td>3-3</td> </tr> </tbody> </table> </body></html>
css table add
border-collapse: collapse;