Wednesday, March 8, 2017

Table row no page break when exporting to PDF

Leave a Comment

Table row is not making page break when table is exported to PDF. I've tried to make page break on each table row with:

<tr style='page-break-inside:avoid;'> 

Table row breaks like this (export to PDF - view inside browser):

enter image description here

I would like table row 'Vrsta blaga/storitve' to stay compact. So, cells are not displayed in non-printable areas, like in the picture above. Is this possible? What styling should I use? Here is my code:

<style>#tblArticles{font-size: 12px !important; font-family: verdana, sans-serif; border-collapse: collapse; width: 100%;}  #tblArticles td{border: 1px solid black;text-align: center;padding: 8px;}  #tblArticles th {border: 1px solid black;text-align: center;padding: 8px;background-color: #dddddd;}  </style>  <style>#tblLeft{position:absolute;left:0; font-size: 10px !important; font-family: verdana, sans-serif;border-collapse:collapse; width:40%;}  #tblLeft td{font-size: 10px !important; border: 1px solid black;text-align: center;padding: 8px;}  #tblLeft th {font-size: 10px !important; border: 1px solid black;text-align: center;padding: 8px;background-color: #dddddd;}</style>  <style>#tblRight{position:absolute;right:0; font-size: 10px !important; font-family: verdana, sans-serif;border-collapse:collapse; width:20%;}  #tblRight td{font-size: 10px !important; text-align: center;padding: 8px;}</style>  <table id='tblArticles'>  <thead>  <th>Vrsta blaga/storitve</th>                                  <th>Interna številka</th>                                  <th>Prodana koda</th>                                  <th>Količina</th>                                  <th>EnM</th>                                  <th>Cena brez DDV</th>                                  <th>Vrednost brez DDV</th>                                  <th>DDV</th>                                  <th>Znesek DDV</th>                                  <th>Vrednost z DDV</th>  </thead>  <tfoot>  <tr style='visibility:hidden;'><td></td></tr>  <tr style='visibility:hidden;'><td></td></tr>  <tr style='visibility:hidden;'><td></td></tr>  </tfoot>  <tbody style='page-break-inside:avoid;'>  <tr style='page-break-inside:avoid;'>  <td rowspan='2'><label>Mali kuharski mojster</label></td>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/VFdNNE5TIE1L.jpg><br/>  <label>VFdNNE5TIE1L</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>2,00</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>KOM</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>32,21 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>64,42 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>22,00 %</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>14,17 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>78,59 €</td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/VjJUOEVaIE1L.jpg><br/>  <label>VjJUOEVaIE1L</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td rowspan='12'><label>Veliki kuharski mojster</label></td>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/NFA1SFFKVks=.jpg><br/>  <label>NFA1SFFKVks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='12'>12,00</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='12'>KOM</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='12'>65,69 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='12'>788,28 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='12'>22,00 %</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='12'>173,42 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='12'>961,70 €</td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/RzZHOFo1Vks=.jpg><br/>  <label>RzZHOFo1Vks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/VUhHOVVZVks=.jpg><br/>  <label>VUhHOVVZVks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/VThWUTdLVks=.jpg><br/>  <label>VThWUTdLVks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/R05YQlNDVks=.jpg><br/>  <label>R05YQlNDVks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/OVQyU1c3Vks=.jpg><br/>  <label>OVQyU1c3Vks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/TTlHUkVOVks=.jpg><br/>  <label>TTlHUkVOVks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/OUtSNUQ2Vks=.jpg><br/>  <label>OUtSNUQ2Vks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/OENQMkNaVks=.jpg><br/>  <label>OENQMkNaVks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/Q1o2Qjc3Vks=.jpg><br/>  <label>Q1o2Qjc3Vks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/V0xNOVJBVks=.jpg><br/>  <label>V0xNOVJBVks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/TjRMOVdBVks=.jpg><br/>  <label>TjRMOVdBVks=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td rowspan='2'><label>Večerja na zajli</label></td>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/Rk5SRFdWVlo=.jpg><br/>  <label>Rk5SRFdWVlo=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>2,00</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>KOM</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>91,56 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>183,12 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>22,00 %</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>40,29 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>223,41 €</td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/OEI4V0FSVlo=.jpg><br/>  <label>OEI4V0FSVlo=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td rowspan='10'><label>Za moške, ki mislijo da kosilo pade z neba</label></td>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/VVpETFhUWk0=.jpg><br/>  <label>VVpETFhUWk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='10'>10,00</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='10'>KOM</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='10'>32,34 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='10'>323,40 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='10'>22,00 %</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='10'>71,15 €</td>  <td style='overflow: hidden; white-space: nowrap;' rowspan='10'>394,55 €</td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/OUJXREo5Wk0=.jpg><br/>  <label>OUJXREo5Wk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/TlA4OVU1Wk0=.jpg><br/>  <label>TlA4OVU1Wk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/NlRTOFRQWk0=.jpg><br/>  <label>NlRTOFRQWk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/VVRQVTRSWk0=.jpg><br/>  <label>VVRQVTRSWk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/WEEzUzZCWk0=.jpg><br/>  <label>WEEzUzZCWk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/TVZWUkVNWk0=.jpg><br/>  <label>TVZWUkVNWk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/RDlGVTVOWk0=.jpg><br/>  <label>RDlGVTVOWk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/TFBBR1pTWk0=.jpg><br/>  <label>TFBBR1pTWk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  <tr style='page-break-inside:avoid;'>  <td>  <img src=http://localhost:53358/resources/Images/EAN128/QkVYQ1ZKWk0=.jpg><br/>  <label>QkVYQ1ZKWk0=</label><br/>  </td>  <td><input type='checkbox'><br/><label></label><br/></td>  </tr>  </tbody>  </table><br/>  <div style='page-break-inside:avoid;margin-bottom: 30px;'>  <label style='position:relative;left:0;font-size:12px;'>Specifikacija obračunanega davka, dokumenta št.:</label><br/>  <div id='divBottom' style='position:relative;width:100%;min-height:160px;'>  <table id='tblLeft'>  <th>Stopnja</th><th>Osnova za DDV</th><th>Znesek DDV</th><th>Vrednost z DDV</th>  <tr>  <td>9,5 %</td><td>0,00 €</td><td>0,00 €</td><td>0,00 €</td>  </tr><tr>  <td>22 %</td><td>1359,22 €</td><td>299,03 €</td><td>1658,25 €</td>  </tr>  </table>  <table id='tblRight'>  <tr style='border-bottom:1px solid black !important;'>  <td style='text-align:left;'><b>Skupaj brez DDV:</b></td><td style='text-align:right;'>1359,22 €</td>  </tr>  <tr>  <td style='text-align:left;'><b>Osnova za DDV</b></td><td style='text-align:right;'>1359,22 €</td>  </tr>  <tr style='border-bottom:1px solid black !important;'>  <td style='text-align:left;'><b>DDV:</b></td><td style='text-align:right;'>299,03 €</td>  </tr>  </table>  <label style='position:absolute;right:80px;bottom:20px;'><b>SKUPAJ:</b></label>  <label style='position:absolute;right:0;bottom:20px;'><b>1658,25 €</b></label>  </div></div><br/><br/><br/>

2 Answers

Answers 1

there is nothing wrong with page-break-inside

it table should be like the following to work for page-break-inside

<tr style='page-break-inside:avoid;'>  <td ><label>Mali kuharski mojster</label></td>  <td class="td">     <table >         <tbody>             <tr>                  <td>                     <img src=http://localhost:53358/resources/Images/EAN128/VFdNNE5TIE1L.jpg><br/>                     <label>VFdNNE5TIE1L</label><br/>                 </td>                    <td><input type='checkbox'><br/><label></label><br/></td>             </tr>                    <tr>                 <td>                     <img src=http://localhost:53358/resources/Images/EAN128/VjJUOEVaIE1L.jpg><br/>                     <label>VjJUOEVaIE1L</label><br/>                 </td>                 <td><input type='checkbox'><br/><label></label><br/></td>             </tr>         </tbody>     </table>              </td>  <td style='overflow: hidden; white-space: nowrap;' >2,00</td>  <td style='overflow: hidden; white-space: nowrap;' >KOM</td>  <td style='overflow: hidden; white-space: nowrap;' >32,21 €</td>  <td style='overflow: hidden; white-space: nowrap;' >64,42 €</td>  <td style='overflow: hidden; white-space: nowrap;' >22,00 %</td>  <td style='overflow: hidden; white-space: nowrap;' >14,17 €</td>  <td style='overflow: hidden; white-space: nowrap;' >78,59 €</td> 

instead of

<tr style='page-break-inside:avoid;'>     <td rowspan='2'><label>Mali kuharski mojster</label></td>     <td>         <img src=http://localhost:53358/resources/Images/EAN128/VFdNNE5TIE1L.jpg><br/>         <label>VFdNNE5TIE1L</label><br/>     </td>     <td><input type='checkbox'><br/><label></label><br/></td>     <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>2,00</td>     <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>KOM</td>     <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>32,21 €</td>     <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>64,42 €</td>     <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>22,00 %</td>     <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>14,17 €</td>     <td style='overflow: hidden; white-space: nowrap;' rowspan='2'>78,59 €</td> </tr> <tr style='page-break-inside:avoid;'>     <td>         <img src=http://localhost:53358/resources/Images/EAN128/VjJUOEVaIE1L.jpg><br/>         <label>VjJUOEVaIE1L</label><br/>     </td>     <td><input type='checkbox'><br/><label></label><br/></td> </tr> 

Restructure the entire html

<style>#tblArticles{font-size: 12px !important; font-family: verdana, sans-serif; border-collapse: collapse; width: 100%;}    #tblArticles td{border: 1px solid black;text-align: center;padding: 8px;}    #tblArticles th {border: 1px solid black;text-align: center;padding: 8px;background-color: #dddddd;} </style> <style>#tblLeft{position:absolute;left:0; font-size: 10px !important; font-family: verdana, sans-serif;border-collapse:collapse; width:40%;}    #tblLeft td{font-size: 10px !important; border: 1px solid black;text-align: center;padding: 8px;}    #tblLeft th {font-size: 10px !important; border: 1px solid black;text-align: center;padding: 8px;background-color: #dddddd;} </style> <style>#tblRight{position:absolute;right:0; font-size: 10px !important; font-family: verdana, sans-serif;border-collapse:collapse; width:20%;}    #tblRight td{font-size: 10px !important; text-align: center;padding: 8px;} </style> <style>     #tblArticles td.td{         padding: 0px;     }      #tblArticles td.td table {         width: 100%;     }      #tblArticles td.td table td{         border: 0px;         border-bottom: 1px solid black;     }       #tblArticles td.td table tr:last-child td{         border-bottom: 0px;         border-top: 0px;     }      #tblArticles th.th {         padding: 0px;        }      #tblArticles th.th table {           padding: 0px;         width: 100%;     }      #tblArticles th.th table th{         border: 0px;     }      #tblArticles th.th table th:first-child{         width: 70%;         border-right: 1px solid black;     }      #tblArticles td.td table tr td:first-child{         width: 70%;         border-right: 1px solid black;     } </style> <table id='tblArticles'>    <thead>       <th>Vrsta blaga/storitve</th>       <th class="th"><table><thead><th>Interna številka</th><th>Prodana koda</th></thead></table></th>       <th>Količina</th>       <th>EnM</th>       <th>Cena brez DDV</th>       <th>Vrednost brez DDV</th>       <th>DDV</th>       <th>Znesek DDV</th>       <th>Vrednost z DDV</th>    </thead>    <tfoot>       <tr style='visibility:hidden;'>          <td></td>       </tr>       <tr style='visibility:hidden;'>          <td></td>       </tr>       <tr style='visibility:hidden;'>          <td></td>       </tr>    </tfoot>    <tbody style='page-break-inside:avoid;'>       <tr style='page-break-inside:avoid;'>          <td ><label>Mali kuharski mojster</label></td>          <td class="td">             <table >                 <tbody>                     <tr>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/VFdNNE5TIE1L.jpg><br/>                             <label>VFdNNE5TIE1L</label><br/>                         </td>                            <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                            <tr>                         <td>                             <img src=http://localhost:53358/resources/Images/EAN128/VjJUOEVaIE1L.jpg><br/>                             <label>VjJUOEVaIE1L</label><br/>                         </td>                         <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                 </tbody>             </table>                      </td>          <td style='overflow: hidden; white-space: nowrap;' >2,00</td>          <td style='overflow: hidden; white-space: nowrap;' >KOM</td>          <td style='overflow: hidden; white-space: nowrap;' >32,21 €</td>          <td style='overflow: hidden; white-space: nowrap;' >64,42 €</td>          <td style='overflow: hidden; white-space: nowrap;' >22,00 %</td>          <td style='overflow: hidden; white-space: nowrap;' >14,17 €</td>          <td style='overflow: hidden; white-space: nowrap;' >78,59 €</td>       </tr>       <tr style='page-break-inside:avoid;'>          <td ><label>Veliki kuharski mojster</label></td>          <td class="td">             <table >                 <tbody>                     <tr>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/NFA1SFFKVks=.jpg><br/>                             <label>NFA1SFFKVks=</label><br/>                         </td>                            <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                            <tr>                         <td>                             <img src=http://localhost:53358/resources/Images/EAN128/RzZHOFo1Vks=.jpg><br/>                             <label>RzZHOFo1Vks=</label><br/>                         </td>                         <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                     <tr>                         <td>                             <img src=http://localhost:53358/resources/Images/EAN128/VUhHOVVZVks=.jpg><br/>                             <label>VUhHOVVZVks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                      <tr >                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/VThWUTdLVks=.jpg><br/>                             <label>VThWUTdLVks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                       <tr>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/VThWUTdLVks=.jpg><br/>                             <label>VThWUTdLVks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                       <tr>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/R05YQlNDVks=.jpg><br/>                             <label>R05YQlNDVks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                       <tr>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/OVQyU1c3Vks=.jpg><br/>                             <label>OVQyU1c3Vks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                     <tr style='page-break-inside:avoid;'>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/TTlHUkVOVks=.jpg><br/>                             <label>TTlHUkVOVks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                       <tr style='page-break-inside:avoid;'>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/OUtSNUQ2Vks=.jpg><br/>                             <label>OUtSNUQ2Vks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                       <tr style='page-break-inside:avoid;'>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/OENQMkNaVks=.jpg><br/>                             <label>OENQMkNaVks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                       <tr style='page-break-inside:avoid;'>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/Q1o2Qjc3Vks=.jpg><br/>                             <label>Q1o2Qjc3Vks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                       <tr style='page-break-inside:avoid;'>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/V0xNOVJBVks=.jpg><br/>                             <label>V0xNOVJBVks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                       <tr style='page-break-inside:avoid;'>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/TjRMOVdBVks=.jpg><br/>                             <label>TjRMOVdBVks=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                       </tr>                 </tbody>             </table>                      </td>          <td style='overflow: hidden; white-space: nowrap;' >12,00</td>          <td style='overflow: hidden; white-space: nowrap;' >KOM</td>          <td style='overflow: hidden; white-space: nowrap;' >65,69 €</td>          <td style='overflow: hidden; white-space: nowrap;' >788,28 €</td>          <td style='overflow: hidden; white-space: nowrap;' >22,00 %</td>          <td style='overflow: hidden; white-space: nowrap;' >173,42 €</td>          <td style='overflow: hidden; white-space: nowrap;' >961,70 €</td>       </tr>            <tr style='page-break-inside:avoid;'>          <td ><label>Večerja na zajli</label></td>          <td class="td">             <table >                 <tbody>                     <tr>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/Rk5SRFdWVlo=.jpg><br/>                             <label>Rk5SRFdWVlo=</label><br/>                         </td>                            <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                            <tr>                         <td>                             <img src=http://localhost:53358/resources/Images/EAN128/OEI4V0FSVlo=.jpg><br/>                             <label>OEI4V0FSVlo=</label><br/>                         </td>                         <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                 </tbody>             </table>                      </td>          <td style='overflow: hidden; white-space: nowrap;' >2,00</td>          <td style='overflow: hidden; white-space: nowrap;' >KOM</td>          <td style='overflow: hidden; white-space: nowrap;' >91,56 €</td>          <td style='overflow: hidden; white-space: nowrap;' >183,12 €</td>          <td style='overflow: hidden; white-space: nowrap;' >22,00 %</td>          <td style='overflow: hidden; white-space: nowrap;' >40,29 €</td>          <td style='overflow: hidden; white-space: nowrap;' >223,41 €</td>       </tr>       <tr style='page-break-inside:avoid;'>          <td ><label>Za moške, ki mislijo da kosilo pade z neba</label></td>          <td class="td">             <table >                 <tbody>                     <tr>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/VVpETFhUWk0=.jpg><br/>                             <label>VVpETFhUWk0=</label><br/>                         </td>                            <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                            <tr>                         <td>                             <img src=http://localhost:53358/resources/Images/EAN128/OUJXREo5Wk0=.jpg><br/>                             <label>OUJXREo5Wk0=</label><br/>                         </td>                         <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                     <tr>                          <td>                             <img src=http://localhost:53358/resources/Images/EAN128/TlA4OVU1Wk0=.jpg><br/>                             <label>TlA4OVU1Wk0=</label><br/>                          </td>                          <td><input type='checkbox'><br/><label></label><br/></td>                     </tr>                      <tr>                      <td>                         <img src=http://localhost:53358/resources/Images/EAN128/TlA4OVU1Wk0=.jpg><br/>                         <label>TlA4OVU1Wk0=</label><br/>                      </td>                      <td><input type='checkbox'><br/><label></label><br/></td>                   </tr>                            <tr>                      <td>                         <img src=http://localhost:53358/resources/Images/EAN128/NlRTOFRQWk0=.jpg><br/>                         <label>NlRTOFRQWk0=</label><br/>                      </td>                      <td><input type='checkbox'><br/><label></label><br/></td>                   </tr>                             <tr>                      <td>                         <img src=http://localhost:53358/resources/Images/EAN128/VVRQVTRSWk0=.jpg><br/>                         <label>VVRQVTRSWk0=</label><br/>                      </td>                      <td><input type='checkbox'><br/><label></label><br/></td>                   </tr>                   <tr>                      <td>                         <img src=http://localhost:53358/resources/Images/EAN128/WEEzUzZCWk0=.jpg><br/>                         <label>WEEzUzZCWk0=</label><br/>                      </td>                      <td><input type='checkbox'><br/><label></label><br/></td>                   </tr>                   <tr>                      <td>                         <img src=http://localhost:53358/resources/Images/EAN128/TVZWUkVNWk0=.jpg><br/>                         <label>TVZWUkVNWk0=</label><br/>                      </td>                      <td><input type='checkbox'><br/><label></label><br/></td>                   </tr>                   <tr>                      <td>                         <img src=http://localhost:53358/resources/Images/EAN128/RDlGVTVOWk0=.jpg><br/>                         <label>RDlGVTVOWk0=</label><br/>                      </td>                      <td><input type='checkbox'><br/><label></label><br/></td>                   </tr>                   <tr>                      <td>                         <img src=http://localhost:53358/resources/Images/EAN128/TFBBR1pTWk0=.jpg><br/>                         <label>TFBBR1pTWk0=</label><br/>                      </td>                      <td><input type='checkbox'><br/><label></label><br/></td>                   </tr>                   <tr>                      <td>                         <img src=http://localhost:53358/resources/Images/EAN128/QkVYQ1ZKWk0=.jpg><br/>                         <label>QkVYQ1ZKWk0=</label><br/>                      </td>                      <td><input type='checkbox'><br/><label></label><br/></td>                   </tr>                                </tbody>             </table>         </td>          <td style='overflow: hidden; white-space: nowrap;' >10,00</td>          <td style='overflow: hidden; white-space: nowrap;' >KOM</td>          <td style='overflow: hidden; white-space: nowrap;' >32,34 €</td>          <td style='overflow: hidden; white-space: nowrap;' >323,40 €</td>          <td style='overflow: hidden; white-space: nowrap;' >22,00 %</td>          <td style='overflow: hidden; white-space: nowrap;' >71,15 €</td>          <td style='overflow: hidden; white-space: nowrap;' >394,55 €</td>       </tr>       </tbody> </table> <br/> <div style='page-break-inside:avoid;margin-bottom: 30px;'>    <label style='position:relative;left:0;font-size:12px;'>Specifikacija obračunanega davka, dokumenta št.:</label><br/>    <div id='divBottom' style='position:relative;width:100%;min-height:160px;'>       <table id='tblLeft'>          <th>Stopnja</th>          <th>Osnova za DDV</th>          <th>Znesek DDV</th>          <th>Vrednost z DDV</th>          <tr>             <td>9,5 %</td>             <td>0,00 €</td>             <td>0,00 €</td>             <td>0,00 €</td>          </tr>          <tr>             <td>22 %</td>             <td>1359,22 €</td>             <td>299,03 €</td>             <td>1658,25 €</td>          </tr>       </table>       <table id='tblRight'>          <tr style='border-bottom:1px solid black !important;'>             <td style='text-align:left;'><b>Skupaj brez DDV:</b></td>             <td style='text-align:right;'>1359,22 €</td>          </tr>          <tr>             <td style='text-align:left;'><b>Osnova za DDV</b></td>             <td style='text-align:right;'>1359,22 €</td>          </tr>          <tr style='border-bottom:1px solid black !important;'>             <td style='text-align:left;'><b>DDV:</b></td>             <td style='text-align:right;'>299,03 €</td>          </tr>       </table>       <label style='position:absolute;right:80px;bottom:20px;'><b>SKUPAJ:</b></label>       <label style='position:absolute;right:0;bottom:20px;'><b>1658,25 €</b></label>    </div> </div> <br/><br/><br/> 

It not entire solution, it gives you an idea, there are still css issues

Answers 2

Remove all inline page-break rules & just add this in the <style>...</style>:

#tblArticles tr{    page-break-before: always; } 

            #tblArticles{                  font-size: 12px !important;                  font-family: verdana, sans-serif;                  border-collapse: collapse;                  width: 100%;              }              #tblArticles tr{                  page-break-before: always;              }              #tblArticles td{                  border: 1px solid black;                  text-align: center;                  /*padding: 8px;*/                  padding: 0;                  margin: 0;                               }              #tblArticles table.inner{                  width: 100%;                  margin: 0;              }              #tblArticles table.inner td{                  padding: 0;                  width: 50%;                  margin: 0;                  padding: 0;              }              #tblArticles th {                  border: 1px solid black;                  text-align: center;                  padding: 8px;                  background-color: #dddddd;              }              #tblLeft{                  position:absolute;                  left:0;                  font-size: 10px !important;                  font-family: verdana, sans-serif;                  border-collapse:collapse;                  width:40%;              }              #tblLeft td{                  font-size: 10px !important;                  border: 1px solid black;                  text-align: center;                  padding: 8px;              }              #tblLeft th {                  font-size: 10px !important;                   border: 1px solid black;                  text-align: center;                  padding: 8px;                  background-color: #dddddd;              }              #tblRight{                  position:absolute;                  right:0;                  font-size: 10px !important;                   font-family: verdana, sans-serif;                  border-collapse:collapse;                   width:20%;              }              #tblRight td{                  font-size: 10px !important;                   text-align: center;                  padding: 8px;              }          
        <table id='tblArticles'>              <thead>                  <tr>                      <th>Vrsta blaga/storitve</th>                      <th>Interna številka</th>                      <th>Prodana koda</th>                      <th>Količina</th>                      <th>EnM</th>                      <th>Cena brez DDV</th>                      <th>Vrednost brez DDV</th>                      <th>DDV</th>                      <th>Znesek DDV</th>                      <th>Vrednost z DDV</th>                  </tr>              </thead>              <tfoot>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>                  <tr style='visibility:hidden;'><td></td></tr>              </tfoot>              <tbody>                  <tr>                      <td><label>Mali kuharski mojster</label></td>                      <td colspan="2">                          <table class="inner">                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/VFdNNE5TIE1L.jpg" /><br/>                                      <label>VFdNNE5TIE1L</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/VjJUOEVaIE1L.jpg" /><br/>                                      <label>VjJUOEVaIE1L</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                          </table>                      </td>                      <td style='overflow: hidden; white-space: nowrap;'>2,00</td>                      <td style='overflow: hidden; white-space: nowrap;'>KOM</td>                      <td style='overflow: hidden; white-space: nowrap;'>32,21 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>64,42 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>22,00 %</td>                      <td style='overflow: hidden; white-space: nowrap;'>14,17 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>78,59 €</td>                  </tr>                  <tr>                      <td><label>Veliki kuharski mojster</label></td>                      <td colspan="2">                          <table  class="inner">                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/NFA1SFFKVks=.jpg" /><br/>                                      <label>NFA1SFFKVks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/RzZHOFo1Vks=.jpg" /><br/>                                      <label>RzZHOFo1Vks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/VUhHOVVZVks=.jpg" /><br/>                                      <label>VUhHOVVZVks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/VThWUTdLVks=.jpg" /><br/>                                      <label>VThWUTdLVks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/R05YQlNDVks=.jpg" /><br/>                                      <label>R05YQlNDVks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/OVQyU1c3Vks=.jpg" /><br/>                                      <label>OVQyU1c3Vks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/TTlHUkVOVks=.jpg" /><br/>                                      <label>TTlHUkVOVks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/OUtSNUQ2Vks=.jpg" /><br/>                                      <label>OUtSNUQ2Vks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/OENQMkNaVks=.jpg" /><br/>                                      <label>OENQMkNaVks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/Q1o2Qjc3Vks=.jpg" /><br/>                                      <label>Q1o2Qjc3Vks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/V0xNOVJBVks=.jpg" /><br/>                                      <label>V0xNOVJBVks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/TjRMOVdBVks=.jpg" /><br/>                                      <label>TjRMOVdBVks=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                          </table>                      </td>                      <td style='overflow: hidden; white-space: nowrap;'>12,00</td>                      <td style='overflow: hidden; white-space: nowrap;'>KOM</td>                      <td style='overflow: hidden; white-space: nowrap;'>65,69 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>788,28 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>22,00 %</td>                      <td style='overflow: hidden; white-space: nowrap;'>173,42 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>961,70 €</td>                  </tr>                  <tr>                      <td><label>Večerja na zajli</label></td>                      <td colspan="2">                          <table class="inner">                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/Rk5SRFdWVlo=.jpg" /><br/>                                      <label>Rk5SRFdWVlo=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/OEI4V0FSVlo=.jpg" /><br/>                                      <label>OEI4V0FSVlo=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                          </table>                      </td>                      <td style='overflow: hidden; white-space: nowrap;'>2,00</td>                      <td style='overflow: hidden; white-space: nowrap;'>KOM</td>                      <td style='overflow: hidden; white-space: nowrap;'>91,56 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>183,12 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>22,00 %</td>                      <td style='overflow: hidden; white-space: nowrap;'>40,29 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>223,41 €</td>                  </tr>                  <tr>                      <td><label>Za moške, ki mislijo da kosilo pade z neba</label></td>                      <td colspan="2">                          <table class="inner">                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/VVpETFhUWk0=.jpg" /><br/>                                      <label>VVpETFhUWk0=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/OUJXREo5Wk0=.jpg" /><br/>                                      <label>OUJXREo5Wk0=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/TlA4OVU1Wk0=.jpg" /><br/>                                      <label>TlA4OVU1Wk0=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/NlRTOFRQWk0=.jpg" /><br/>                                      <label>NlRTOFRQWk0=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/VVRQVTRSWk0=.jpg" /><br/>                                      <label>VVRQVTRSWk0=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/WEEzUzZCWk0=.jpg" /><br/>                                      <label>WEEzUzZCWk0=</label>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/TVZWUkVNWk0=.jpg" /><br/>                                      <label>TVZWUkVNWk0=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/RDlGVTVOWk0=.jpg" /><br/>                                      <label>RDlGVTVOWk0=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/TFBBR1pTWk0=.jpg" /><br/>                                      <label>TFBBR1pTWk0=</label><br/>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                              <tr>                                  <td>                                      <img src="http://localhost:53358/resources/Images/EAN128/QkVYQ1ZKWk0=.jpg" /><br/>                                      <label>QkVYQ1ZKWk0=</label>                                  </td>                                  <td><input type='checkbox'><br/><label></label><br/></td>                              </tr>                          </table>                      </td>                      <td style='overflow: hidden; white-space: nowrap;'>10,00</td>                      <td style='overflow: hidden; white-space: nowrap;'>KOM</td>                      <td style='overflow: hidden; white-space: nowrap;'>32,34 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>323,40 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>22,00 %</td>                      <td style='overflow: hidden; white-space: nowrap;'>71,15 €</td>                      <td style='overflow: hidden; white-space: nowrap;'>394,55 €</td>                  </tr>              </tbody>          </table>          <br/>          <div style='page-break-inside:avoid;margin-bottom: 30px;'>              <label style='position:relative;left:0;font-size:12px;'>Specifikacija obračunanega davka, dokumenta št.:</label><br/>              <div id='divBottom' style='position:relative;width:100%;min-height:160px;'>                  <table id='tblLeft'>                      <th>Stopnja</th><th>Osnova za DDV</th><th>Znesek DDV</th><th>Vrednost z DDV</th>                      <tr>                          <td>9,5 %</td><td>0,00 €</td><td>0,00 €</td><td>0,00 €</td>                      </tr><tr>                          <td>22 %</td><td>1359,22 €</td><td>299,03 €</td><td>1658,25 €</td>                      </tr>                  </table>                  <table id='tblRight'>                      <tr style='border-bottom:1px solid black !important;'>                          <td style='text-align:left;'><b>Skupaj brez DDV:</b></td><td style='text-align:right;'>1359,22 €</td>                      </tr>                      <tr>                          <td style='text-align:left;'><b>Osnova za DDV</b></td><td style='text-align:right;'>1359,22 €</td>                      </tr>                      <tr style='border-bottom:1px solid black !important;'>                          <td style='text-align:left;'><b>DDV:</b></td><td style='text-align:right;'>299,03 €</td>                      </tr>                  </table>                  <label style='position:absolute;right:80px;bottom:20px;'><b>SKUPAJ:</b></label>                  <label style='position:absolute;right:0;bottom:20px;'><b>1658,25 €</b></label>              </div></div>

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment