如何在html上只打印我想要的分区?

时间:2016-10-13 13:13:15

标签: php html css

大家好我想在打印部分只显示此部门, 这会是什么剧本?顺便说一下,这是桌子上每个租户的模式。此印刷品将作为每个租户的收据。

select productid, max(gender) as gender, max(color) as color, max(type) as Type, max(AgeRange) as AgeRange 
from yourtable group by ProductId 

2 个答案:

答案 0 :(得分:1)

如果我没有错,那么下面的代码就会做你想要的。有关更多信息,请参阅MDN documentation about @media

@media print {
    body * { 
        visibility: hidden; 
    }
    .modal-body* { 
        visibility: visible; 
    }
    .modal-body{ 
        display: block!important; 
        position: absolute; 
        top: 40px; 
        left: 30px; 
    }
}

答案 1 :(得分:0)

media query for printing

@media print {
    /*your printing specific css here*/
}