永发信息网

CSS样式问题!

答案:3  悬赏:70  手机版
解决时间 2021-05-01 12:47
  • 提问者网友:树红树绿
  • 2021-05-01 08:24

我做了一张表格!现在样式出现了问题!我是直接从网上摘的样式!现在的问题是!数据库中如果没数据!结果显示在页面上表格也没了!我需要即便没有数据表格依然存在!样式如下

<style type="text/css">
body {margin:0 6px 0 0px; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333; }
td {font-size: 11px; font-family: Arial, Helvetica, sans-serif; height:20px; padding-left:1px; color: #333333;}
html, td, select, input, option, textarea, th { font:11px Arial, Helvetica, sans-serif;}
a, a:link, a:visited{text-decoration:none; color:#333;}
a:hover{text-decoration:underline; color:#FF0000;}
a:active{color:#CC0000;}
img{ border:0; vertical-align:middle}
pre{margin:0; padding:0; line-height:16px}
hr{ height:1px; padding:0; margin:3px 0; border:1px solid #ccc; border-width: 0 0 1px 0;}
cite{ font-style:normal; display:block; padding:3px 0;}
input,textarea,select { font-size:11px; vertical-align: middle; text-align:center ;padding-top: 1px;}
.input_attach {font-size:11px; vertical-align: middle; text-align:left ; width: 220px; padding-top: 1px;}
.input_note {font-size:11px; vertical-align: middle; text-align:left ; width:260 px; padding-top: 1px; }
.Input_Date {size:7;}
.Input_right {text-align:right;}
.input,text {font-size:11px; vertical-align: middle; text-align:right ;padding-top: 1px;}
#main {width:100%;}
.top {color:#4A5255;font-weight:bold; padding:0px 0 5 5px; font-family: Verdana, Arial;font-size: 11px;}
.topFrame {width:100%; height:58; align:left; border:0; marginwidth:1 ;marginheight:1;}
.MenuFrame {width:200; height:100%; border=0 background:url(../images/bg_leftmenu.gif) no-repeat; }
.Menu {margin:0 6px 0 0px; font-size: 11px; color: #000000; font-weight:bold; font-family: Arial, Helvetica; text-decoration: none;}
.Menu_sub {margin:0 6px 0 0px; font-size: 11px; color: #555555; font-family: Verdana, Arial, Helvetica; text-decoration: none;}

.B {font-weight:bold;}

.white {background:#FFFEEA; height:25px;}
.Red_text {font-size: 11px; font-family: Arial, Helvetica, sans-serif; color:red;}
.approvalline_text {font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color:Gray;}
.TR_Add {height:30px;font-size:12px; padding-left:5px;}
.TR_List { background:#FFFFFF; font-size:12px; line-height:25px;}
.TD_S { font-size:11px; font-family: Arial, Helvetica, sans-serif; line-height: 15px;}
.Menu_s_text { font-size:11px; font-family: Arial Narrow, Virinda,;}
.Path {font-size:10px; font-family: Arial, Helvetica, sans-serif; color:#000000; line-height: 15px;}
.a {font-size:15px; font-family: Arial, Helvetica, sans-serif; font-weight:bold; color:Red; line-height:25px;}
.Gray_11{ font-size: 11px; font-family: Arial, Helvetica, sans-serif; height:20px; color:#888888;}
.Print_table{ font-size: 13px; border-color:#000000,border-colorlight:#000000; border-colordark:#ffffff; height:20px; color:#000000;align:center;}
.Print_title{ font-size: 21px; height:30px; color:#000000;align:center;}
.Print_subtitle{ font-size: 18px; height:30px; color:#000000;align:center;}
.Print_content{ font-size: 13px; height:20px; color:#000000; align:center;}

.form_div {color:#FFFFFF; width:100%; margin-top:5px; background:url('../images/div_bg.gif'); font-size:11px; font-family: Arial, Helvetica, sans-serif;}
.form_div fieldset{ padding:3px;}

.form_div_Body {color:#FEFEFE; width:100%; margin-top:12px; background:url('../images/div_body_bg.gif'); repeat: non; font-size:11px; font-family: Arial, Helvetica, sans-serif;}
.form_div_Body fieldset {padding:3px;}
.field_title {height:15px; line-height:20px; font-size:12px; font-weight:bold;}
.ico_human {padding-left:23px; background:url('../images/human_g.gif') no-repeat 2px 3px; align:texttop}
.ico_table {padding-left:23px; background:url('../images/table.gif') no-repeat 2px -2px;}
.ico_flow {padding-left:23px; background:url('../images/chart_organisation.gif') no-repeat 2px -2px;}

.box_table2 a { color:#darkgreen;}
.box_table2 tr{ line-height:25px; background-color:expression((this.sectionRowIndex%2==0)?"#F7F7F5":"");}
.box_table2 td {line-height:22px;}
.boxhead {color:#5B838D; font-size:15px; font-family:Arial; text-align:center; font-weight:bold; line-height:15px; background:url('../images/bot_title.gif')}
.boxhead td {color:#5B838D; font-size:15px; font-family:Arial; text-align:center; font-weight:bold; line-height:15px; background:url('../images/bot_title.gif')}

.title_head_list { height:25px; color:#5B818C; font-weight:bold;text-align:center; background:url('../images/title_head.gif');}
.title_head_li { height:25px; color:#5B818C; text-align:center; font-weight:bold; background:url('../images/bot_title.gif'); line-height:12px}
.btnSelect {width:50px; height:23px; border:medium none; color:#000000; cursor:pointer; font-size:10px; text-valign:top; text-align:center; font-weight:bold; font-family: Arial, Helvetica, sans-serif;background:url('../images/icon_select.gif');padding-left:15px;}
.btnNormal {width:50px; height:23px; border:medium none; color:#000000; cursor:pointer; text-valign:top; text-align:center;font-weight:bold; font-family: Arial, Helvetica, sans-serif;background:url('../images/icon_select.gif');padding-left:5px;}
.btnNormal_1 {width:68px; height:23px; border:medium none; color:#000000; cursor:pointer; text-valign:top; font-weight:bold; font-family: Arial, Helvetica, sans-serif;background:url('../images/icon_select_2.gif');}
.btnHelp {width:29px; height:23px; border:medium none; color:red; valign:top; font-weight:bold; font-size:15px; cursor:pointer; background:url('../images/help.gif');}
.btnRed {width:66px; height:23px; border:medium none; color:#FFFFFF; cursor:pointer; text-valign:top; font-weight:bold; font-family: Arial, Helvetica, sans-serif;background:url('../images/icon_bottom_red.gif');}
.btnLen {width:104px; height:23px; border:medium none; color:#FFFFFF; cursor:pointer; text-valign:top; font-weight:bold; font-family: Arial, Helvetica, sans-serif;background:url('../images/c_btn.gif');}
.btnAdd {width:40px; height:23px; border:medium none; color:#000000; cursor:pointer; text-valign:top; text-align:right; font-weight:bold; font-family: Arial, Helvetica, sans-serif;background:url('../images/icon_select.gif');}


.box_table {border-collapse: collapse; font-size:11px; width: 50%;background-color:#fff; }
.box_table tr{line-height:25px; background-color: expression((this.sectionRowIndex%2==0)?"#FAFAFA":"");}
.box_table td{ border-style:solid; border-width:1px 1px 1px 1px; border-color:#E5E4E4; line-height:25px font-size:11px; padding-left: 2px;}
.box_table tr:hover,
.box_table tr.hilite { background-color: #f2fdff; color: #000000;}


.box_table1 {border-collapse: collapse; font-size:11px; width: 100%;background-color:#fff; margin-top:5;}
.box_table tr{line-height:25px; background-color: expression((this.sectionRowIndex%2==0)?"#FAFAFA":"");}
.box_table1 td{ border-style:solid; border-width:1px 1px 1px 1px; border-color:#DDDDDD; line-height:20px font-size:11px; padding-left:2px;}
.box_table1 tr:hover,
.box_table1 tr.hilite { background-color: #f2fdff; color: #000000;}


.box_table4 {border-collapse:0; cellspacing:0; cellpadding:0; collapse:0; border-width:0px 0px 0px 0px; font-size:11px; width: 100%;}
.box_table4 tr{line-height:16px;}
.box_table4 td{ line-height:16px; font-size:11px; color: #000000; font-weight:bold; padding-left:2px;}
.box_table4 tr:hover,
.box_table4 tr.hilite { background-color: #f2fdff; color: #000000;}


.box_table3 {border-collapse: collapse; font-size:11px; width: 100%; margin-top:5;}
.box_table3 tr{line-height:25px; }
.box_table3 td{ border-style:solid; border-width:1px 1px 1px 1px; border-color:#AAAAAA; line-height:25px font-size:11px; padding-left:2px;}
</style>

最佳答案
  • 五星知识达人网友:妄饮晩冬酒
  • 2021-05-01 09:20

其实页面的后台是可以看到这样的标签的<td></td>


但由于td中没有内容。再加上td没有设置样式


浏览器默认他的高和宽为0。所以看不到


若你把每个<td>加一个样式


<td width="10" height="10"></td>这样的话,哪怕没有内容,它也有高和宽。如此就不会出现消失的假象了


。但还是采用&nbsp;的方案好写

全部回答
  • 1楼网友:渡鹤影
  • 2021-05-01 11:44

楼上正解

  • 2楼网友:患得患失的劫
  • 2021-05-01 10:56

做判断,,如果取出的为空,,输出 &nbsp;

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯