整理的Table 的Css /*定义表格*/ .mytable { BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid; WIDTH: 100%; BORDER-BOTTOM: #ffffff 1px solid; background-color:#F1F3F5; } .mytable td { border-right:#fff 1px solid; border-top:#fff 1px solid; border-left:#fff 1px solid; border-bottom:#fff 1px solid; } .mytable caption { background-color:#3896d1; border-color:#FFFFFF; color:#FFFFFF; text-align:center; font-size: 12px; font-style: normal; font-weight:bold; } .mytable th { background-color:#CEE3F6; border-color:#FFFFFF; color:#000; text-align:center; font-size: 12px; font-style: normal; font-weight:bold; } /*单元格左对齐*/ .tdleft{ text-align:left; background-color:#F1F3F5; } /*单元格右对齐*/ .tdright{ text-align:right; background-color:#F1F3F5; } .tdleft span{color:Red ;} .tdrightnoFFF{ text-align:right; } 页面代码 <!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> <title></title> <mce:style type="text/css"><!-- /*定义表格*/ .mytable { WIDTH: 100%; background-color:#F1F3F5; border:solid 1 #fff; border-collapse: collapse; text-align :center ; } .mytable td{border:solid 1 #fff;border-collapse: collapse; } .mytable caption { background-color:#3896d1; border:solid 1 #fff; color:#FFFFFF; text-align:center;border-collapse: collapse; font-size: 12px; font-style: normal; } .mytable th { background-color:#CEE3F6; border:solid 1 #fff; color:#000; text-align:center; font-size: 12px;border-collapse: collapse; font-style: normal; font-weight:bold; } /*单元格左对齐*/ .tdleft{ text-align:left; background-color:#F1F3F5;border-collapse: collapse; } /*单元格右对齐*/ .tdright{ text-align:right; background-color:#F1F3F5;border-collapse: collapse; } .tdleft span{color:Red ;} --></mce:style><style type="text/css" mce_bogus="1"> /*定义表格*/ .mytable { WIDTH: 100%; background-color:#F1F3F5; border:solid 1 #fff; border-collapse: collapse; text-align :center ; } .mytable td{border:solid 1 #fff;border-collapse: collapse; } .mytable caption { background-color:#3896d1; border:solid 1 #fff; color:#FFFFFF; text-align:center;border-collapse: collapse; font-size: 12px; font-style: normal; } .mytable th { background-color:#CEE3F6; border:solid 1 #fff; color:#000; text-align:center; font-size: 12px;border-collapse: collapse; font-style: normal; font-weight:bold; } /*单元格左对齐*/ .tdleft{ text-align:left; background-color:#F1F3F5;border-collapse: collapse; } /*单元格右对齐*/ .tdright{ text-align:right; background-color:#F1F3F5;border-collapse: collapse; } .tdleft span{color:Red ;} </style> </head> <body> <table class="mytable" cellpadding="1" cellspacing="2" style="border-collapse: collapse;" mce_style="border-collapse: collapse;"> <caption >修改信息</caption> <tr> <td class="tdright">名称</td> <td class="tdleft"><input type=text/><span>*</span></td> </tr> <tr> <td class="tdright">描述</td> <td class="tdleft"><input type=text/></td> </tr> <tr><td> </td><td > <input type=button value="保存"/></td></tr> </table> <table class="mytable" cellpadding="1" cellspacing="2" > <caption >列表信息</caption> <thead > <th>编号</th> <th>姓名</th> <th>操作</th> </thead> <tr> <td>100001</td> <td>hello</td> <td>修改 </td> </tr> </table> </body> </html>