# How to split rows in a SimpleTable?

**URL:** <https://www.ruby-forum.com/t/how-to-split-rows-in-a-simpletable/107532>\
**Category:** Rails\
**Created:** [June 22, 2007, 5:47pm UTC](https://www.ruby-forum.com/t/how-to-split-rows-in-a-simpletable/107532 "2007-06-22T17:47:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mffreire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@mffreire](https://www.ruby-forum.com/u/mffreire)\
**Post date:** [June 22, 2007, 5:47pm UTC](https://www.ruby-forum.com/t/how-to-split-rows-in-a-simpletable/107532/1 "2007-06-22T17:47:57Z")

</div>

Hi people!

I’m creating a PDF using PDF::Writer and need to include a Simpletable  
with more rows than my page\_height.  
The problem is that is printing values beyond bounderies and overwriting  
the footer.  
Can anyone give me a reference about how to deal with this kind of  
problem?

Thanks in advance

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* My code \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
def write\_header

# my header code

end

def write\_footer

# my footer code

end

def create\_table\_compliance

```
  table = PDF::SimpleTable.new
  table.title = "Compliance Report - Checking directories for

```

errors"  
table.column\_order = [“modules”, “file”]

```
  table.columns["Module"] = PDF::SimpleTable::Column.new("modules")

```

{ |col|  
col.heading = “Module”  
}  
table.columns[“File”] = PDF::SimpleTable::Column.new(“file”) {  
|col|  
col.heading = “File”  
}

```
  table.show_lines = :all
  table.show_headings = true
  table.orientation = :center
  table.position = :center
  table.shade_rows = :none
  #table.protect_rows = 30
  table.minimum_space = 0
  table.header_gap = 50

  table.data = Array.new
  session[:info].each do |dir, hold|
      hold.each do | hashh |
      hashh.each do |key, value|
        if value == 1 or value == 3
                  table.data << {"modules" => "#{dir}", "file" =>

```

“#{key}”}  
else  
# Don’t show  
# \_p.text “OK”  
end  
end  
end  
end  
table.render\_on(@pdf)  
end

# Main Method

def pdfCompliance  
if session[:info] != nil  
setupPDF  
write\_header  
write\_footer  
create\_table\_compliance  
@pdf.stop\_page\_numbering(true, :current)  
send\_data @pdf.render, :filename =\>  
“ComplianceReport-at-#{Time.now.to\_s(:short)}.pdf”, :type =\>  
“application/pdf”  
else  
flash.now[:notice] = “No data on Session dude!”  
end  
end
