Method: ReVIEW::LATEXBuilder#table_rows

Defined in:
lib/review/latexbuilder.rb

#table_rows(sepidx, rows) ⇒ Object



754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
# File 'lib/review/latexbuilder.rb', line 754

def table_rows(sepidx, rows)
  if sepidx
    sepidx.times do
      cno = -1
      tr(rows.shift.map do |s|
           cno += 1
           th(s, @cellwidth[cno])
         end)
    end
    rows.each do |cols|
      cno = -1
      tr(cols.map do |s|
           cno += 1
           td(s, @cellwidth[cno])
         end)
    end
  else
    rows.each do |cols|
      h, *cs = *cols
      cno = 0
      tr([th(h, @cellwidth[0])] +
         cs.map do |s|
           cno += 1
           td(s, @cellwidth[cno])
         end)
    end
  end
end