蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 |
 您目前的位置:首页 > 自由软件 > 技术交流 > 应用编程


    

蓝森林 http://www.lslnet.com 2006年8月25日 8:28

[asp]关于用样式美化数据表显示的问题?

各位好!
在下有一小事求教:
如果我想让数据表显示在页面上的效果这样,比方说表格边框为1个像素,背景颜色为#eeeeee,那这些样式应该在哪个位置设置呢?
<table border="1" bgcolor="#efefef" >
<tr>
<th>姓名</th>
<th>民族</th>
<th>宗教信仰</th>
<th>职业</th>
<th>电子邮箱</th>
</tr>
<%
        objrs.movelast
        while not objrs.bof
         response.write"<tr><td>"&objrs("name")&"</td>"
         response.write"<td>"&objrs("minzu")&"</td>"
         response.write"<td>"&objrs("zongjiao")&"</td>"
         response.write"<td>"&objrs("job")&"</td>"
         response.write"<td>"&objrs("email")&"</td></tr>"
        objrs.moveprevious

        wend
%>
</table>

送你个例子,虽然不是完美的通过标准的CSS来实现,但是至少实现了效果
[html]
<!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>Untitled Document</title>
<style type="text/css">
#t5{width:80%;background-color:#f00;}
#t5 td{background-color:#fff;}
</style>
</head>

<body>
<table cellpadding="1" cellspacing="1" id="t5">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
[/html]

多谢了!!




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com