用CSS 给这个表格里面的每个小格加上边框,怎么加呢?

如题所述

table{ border-collapse:collapse;} //去掉表格的间隙
table th,table td{ border:1px solid #eee;} //给表格的标题和单元格的边框设置为1像素颜色是#eee的实线

做个任务求采纳
温馨提示:内容为网友见解,仅供参考
第1个回答  2015-09-30
<!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>无标题文档</title>
</head>

<body>
<table cellspacing="1" bordercolor="#990000" cellpadding="1" border="1">
<tr height="16">
<td width="357" height="16">test</td>
<td>test</td>
<td width="126">test</td>
<td width="168">test</td>
<td width="252">test</td>
</tr>
<tr height="42">
<td height="42"> </td>
<td> </td>
<td> </td>
<td> </td>
<td>test</td>
</tr>
</table>
</body>
</html>

就是在table那个标签内加上border="1"的属性,给它个值就行了
第2个回答  2012-12-27
<style type="text/css">
table{ border-collapse:collapse;}
table th,table td{ border:1px solid #ccc;}
</style>