日期:2014-05-17  浏览次数:21004 次

字段为空的表格边框无法显示
我有一个循环表格,当字段为空时表格边框就不显示,怎么才能让它在字段为空时也显示出来.
do   while   NOT   rs.EOF  
                <tr   height= "26 ">
                    <td   width= "4% "   align= "center "> <%=rs( "list ")%> </td>
                    <td   width= "13% "   align= "center "> <%=rs( "material ")%> </td>  
                    <td   width= "11% "   align= "left "> <%=rs( "specs ")%> </td>
                    <td   width= "6% "   align= "center "> <%=rs( "unit ")%> </td>
                    <td   width= "6% "   align= "center "> <%=rs( "number ")%> </td>
                    <td   width= "6% "   align= "right "> <%=rs( "unit_price ")%> </td>
                    <td   width= "6% "   align= "right "> <%=rs( "money ")%> </td>
                    <td   width= "30% "   align= "left "> <%=rs( "remark ")%> </td>          
                </tr>
loop

------解决方案--------------------
function show(cont)
if trim(cont)= " " or isnull(cont) then
show= "&nbsp; "
else
show=trim(cont)
end if
end function
直接调用这个就好啦
例如
<td width= "30% " align= "left "> <%=show(rs( "remark "))%> </td>

------解决方案--------------------
不用判断,默认就有一个空格就可以了,如果不嫌充的话]
eg:
<td width= "30% " align= "left "> <%=rs( "remark ")%> &nbsp; </td>

或者:
给table定义样式为以下的tc

<style>
.tc{
border:1px solid #888;
border-collapse: collapse;

}
.tc td{
border:1px solid #888;
padding:0px;
height:20px;
}
</style>

示例:
<table width= "100% " class= "tc ">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>

</table>