Skip to content

k186/multiple-print

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

###multiple-print this plugins depend on jqprint , i made some change for it ,and can print with mutiple dom selector

##demo

###how to use it

add print style with media='print'

  <link href="css/print.css" rel="stylesheet" media="print"/>

and your html

<div id="table1">
    <div id="print1" class="breakpage">
        <table>
            <thead>
            <tr>
                <th>head</th>
                <th>head</th>
                <th>head</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>someText</td>
                <td>someText</td>
                <td>someText</td>

            </tr>

            </tbody>
        </table>
    </div>
</div>
<div id="table2" class="breakpage">
    <div id="print2">
        <table>
            <thead>
            <tr>
                <th>head</th>
                <th>head</th>
                <th>head</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>someText</td>
                <td>someText</td>
                <td>someText</td>

            </tr>

            </tbody>
        </table>
    </div>
</div>

print some dom with

$('#print1').jqprint()

//multiple-print
$('#print1,#print2').jqprint()

force page break css

.breakpage {
    page-break-after: always;
}

.breakpage:last-child {
    page-break-after:avoid;
}