I'm using **gem wiked\_pdf** in my Rails application that generates report.

But I'm having trouble fixing the breaking of data when having more that 1 page.

Please see image.[![enter image description here](https://i.stack.imgur.com/Ayzxn.png)](https://i.stack.imgur.com/Ayzxn.png)

I tried many time to adjust the margin or spacing, but still unable to fix it.

```
respond_to do |format|
  format.html
  format.pdf do
    render title:         @report_title,
           pdf:           @report_title,
           template:      'applicants/generate_report.pdf.erb',
           encoding:      'UTF-8',
           orientation:   'Landscape',
           layout:        'pdf_template.html',               
           footer: {
                    center:    '[page] of [topage]',
                    right:     "",
                    font_name: 'Arial',
                    font_size: 8                        
                   },
           margin: {
                    top:     10, # default 10 (mm)
                    bottom:  12,
                    left:    7,
                    right:   7 
                   },
          spacing: 0
  end
end

```

I also tried to apply **CSS**, like:

```
@media print {
  td, tr {page-break-inside: avoid; }
  table.full_report_table>tbody>tr>td {page-break-inside: avoid !important; }
}

```

Nothing works!

Please help!