table 细边框
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=GB2312" /> <title>css table 之1px边框单元格--脚本之家</title> </head> <body> <style type="text/css"> .myTable,.myTable td { border:1px solid #cccccc; border-collapse:collapse; } </style> <table width="200" class="myTable" > <tr> <td>脚本之家</td> <td>脚本之家</td> <td>脚本之家</td> </tr> <tr> <td>脚本之家</td> <td>脚本之家</td> <td>脚本之家</td> </tr> <tr> <td>脚本之家</td> <td>脚本之家</td> <td>脚本之家</td> </tr> </table> </body> </html> 详细出处参考:http://www.jb51.net/article/15462.htm 如果 table 没有 class 属性的话可以用 : <style type="text/css"> table, td { border:1px solid #cccccc; border-collapse:collapse; } </style> 注意 table和 td 之间有个 “,”逗号。
作者:沐雪
文章均系作者原创或翻译,如有错误不妥之处,欢迎各位批评指正。本文版权归作者和博客园共有,如需转载恳请注明。
如果您觉得阅读这篇博客让你有所收获,请点击右下方【推荐】
为之网-热爱软件编程 http://www.weizhi.cc/