asp.net中table的背景颜色无法打印出来?    <div style="display:none; width: 1022px;" id="printPerList">
<div style=" width:1024px; height:20px;"></div>
    <div style=" width:1014px; height:90px; float:left;">
        <table cellpadding="0"; cellspacing="0"; style=" border:1px solid black; text-align:left;">
        
        <tr style=" height:30px; ">
        <td style=" width:35px; border-right:1px solid black;border-bottom:1px solid black;">总计</td>
        <td style=" width:295px; border-right:1px solid black; background-color:Gray;">&nbsp;</td>
        <td style=" width:60px; border-right:1px solid black;border-bottom:1px solid black;">A=</td>
        <td style=" width:50px; border-right:1px solid black;border-bottom:1px solid black;">C=</td>
        <td style=" width:50px; border-right:1px solid black;border-bottom:1px solid black;">E=</td>
        <td style=" width:65px; border-right:1px solid black;border-bottom:1px solid black;">G=</td>
        <td style=" width:65px; border-right:1px solid black;border-bottom:1px solid black;">I=</td>
        <td style=" border-right:1px solid black; border-bottom:1px solid black; width: 85px;" >K=</td>
        <td style=" border-right:1px solid black;border-bottom:1px solid black; width:55px;">&nbsp;</td>
        <td style=" border-right:1px solid black;border-bottom:1px solid black;width:55px;">&nbsp;</td>
        <td style=" width:2px; border-right:1px solid black; border-bottom:1px solid black;width:55px;">
            &nbsp;</td>
        <td style=" width:24px;border-bottom:1px solid black;">&nbsp;</td>
        </tr>
        <tr style=" height:30px;">
              <td style=" width:35px; border-right:1px solid black; border-bottom:1px solid black;">平均</td>
        <td style=" width:295px; border-right:1px solid black; background-color:Gray;  ">&nbsp;</td>
        <td style=" width:60px; border-right:1px solid black; border-bottom:1px solid black;">B=</td>
        <td  colspan=4 style=" width:240px; border-right:1px solid black; background-color:Gray; border-bottom:1px solid black;  ">&nbsp;</td>
        <td style=" border-right:1px solid black; border-bottom:1px solid black; width: 85px;" >L=</td>
        <td colspan=3 style=" width:180px; border-right:1px solid black;background-color:Gray;  border-bottom:1px solid black; ">
            &nbsp;</td>
        <td style=" width:74px;background-color:Gray; border-bottom:1px solid black;">&nbsp;</td>
        </tr>
        <tr style=" height:30px; ">
                <td style=" width:35px; border-right:1px solid black;">%</td>
        <td style=" width:295px; border-right:1px solid black; background-color:Gray;">&nbsp;</td>
        <td style=" width:60px; border-right:1px solid black;">&nbsp;</td>
        <td style=" width:60px; border-right:1px solid black;">D=</td>
        <td style=" width:60px; border-right:1px solid black;">F=</td>
        <td style=" width:60px; border-right:1px solid black;">H=</td>
        <td style=" width:60px; border-right:1px solid black;">J=</td>
        <td colspan=4 style=" width:300px; border-right:1px solid black;background-color:Gray; ">
            &nbsp;</td>
        <td style=" width:74px; background-color:Gray;">&nbsp;</td>
        </tr>
        </table>
        </div>
</div>//打印
function printPage(naem) {
    var newWindow = window.open('printer.html', '', '');
    var titleHTML = document.getElementById(naem).innerHTML;
    newWindow.document.write(titleHTML);
    newWindow.document.location.reload();
    newWindow.print();
}
js打印的时候,背景颜色总是打印不出来,internet工具>高级>打印背景颜色和图像,这个设置我也设了。还是打印不出来,各位高手这个问题怎么解决?

解决方案 »

  1.   

    用<asp:Table>控件,什么都有了
      

  2.   

    把<table cellpadding="0"; cellspacing="0"; style=" border:1px solid black; text-align:left;">
    用这个table的样式:
    <table style='BORDER-COLLAPSE: collapse;' borderColor='black' border='1' bgcolor=#dddddd>(tr的背景色设为#ffffff)代替看看。
      

  3.   

    IE=>工具=>INTERNET选项=>高级=>打印=>打印背景颜色和背景图片.
    其他浏览器也类似.
    不知道是不是楼主想要的,如果是了请赶快结帖!