1
votes

I have the following code to generate a table in pdf :

  def member_list
    move_down 20
    table member_list_rows do
      self.row(0).align = :center
      row(0).background_color = '3498db'
      row(0).text_color = "FFFFFF"
      self.row_colors = ["DDDDDD", "FFFFFF"]
      self.header = true
    end
  end

In here, how can I change the font size in the table cells? I tried many methods (style, font_size, size) nothing works! What is the correct way?

1
Give this a try: cell.style size: 20, where 20 is the font size.vee
@vee It says undefined local variable or method cell' for #<Prawn::Table:0x00000006555a68>`THpubs
Oh no no, I meant that cell to be your table cell.vee
@vee sorry didn't understand you. where should i put that line?THpubs
Try row(0).columns(0).style size: 20 basically anywhere within the table block.vee

1 Answers

1
votes

In the Prawn manual under table/cell_text.rb you can find

table data, :cell_style => { :size => 18, :text_color => "346842" }

You can style a host of other things except for the size as you see.