我必须打印一些东西,它必须非常具体。
现在,我尽可能地走了,但我想知道的是如何使表适合指定的边距。
/* ===== Printing ===== */ @media print { /*Reset Style*/ body { margin:0; padding:0; } /*Remove Element*/ .main, .wrapper, .pat_index_col1, #header, #footer, .dataTables_wrapper, #h4 { display:none; } .print { height: 132.283464567px; width: 264.566929134px; border:1px solid #000; border-radius:5px; page-break-inside:avoid; } table { width: 264.566929134px; height: 132.283464567px; } thead { font-family:Arial, Helvetica, sans-serif; font-size:10px; } tbody { font-family:Arial, Helvetica, sans-serif; font-size:12px; } tfoot { font-family:Arial, Helvetica, sans-serif; font-size:8px; background-color:#060; } }我需要表格符合上面指定的参数。 它们必须很大,因为它们需要适合特殊标签。
有没有办法可以在print语句中放置一个表格,以便它强制适应那些“边距”? 或者,如果有另一种方法来打印HTML以使其符合指定的尺寸,我将非常愿意调查它。
I have to print something and it's got to be pretty specific.
Now, I've gone as far as I can, but what I want to know is how to make a table fit within the margins specified.
/* ===== Printing ===== */ @media print { /*Reset Style*/ body { margin:0; padding:0; } /*Remove Element*/ .main, .wrapper, .pat_index_col1, #header, #footer, .dataTables_wrapper, #h4 { display:none; } .print { height: 132.283464567px; width: 264.566929134px; border:1px solid #000; border-radius:5px; page-break-inside:avoid; } table { width: 264.566929134px; height: 132.283464567px; } thead { font-family:Arial, Helvetica, sans-serif; font-size:10px; } tbody { font-family:Arial, Helvetica, sans-serif; font-size:12px; } tfoot { font-family:Arial, Helvetica, sans-serif; font-size:8px; background-color:#060; } }I need the table to fit within the parameters specified above. They have to be that big because they need to fit inside special labels.
Is there a way you can put a table within the print statement so that it forces to fit within those 'margins'? Or if there is another way to print HTML so it fits into the specified dimensions, I would be more than willing to look into it.
最满意答案
对于我打算做的事情(或尝试做的事情),我决定选择jsPDF ,就像我想做的那样。
For what I intend to do (or try and do), I decided to go with jsPDF as it did what I wanted to do.
更多推荐
发布评论