Question

I want to specify a font style for a certain cell. What I found in the documentation is the capacity to do it for all the cell, but not for one I need:

table data, :cell_style => { :font => "Times-Roman", :font_style => :italic }

How do I do that for only one cell?

Was it helpful?

Solution

Turn your table into a block to do more configuration and then you can find it by row and column. See line 2 for your font, I included a couple other examples to set styles by rows & columns:

table(invoice_header_data, width: 210) do
  style(row(0).column(0), font: "Times-Roman")
  style(rows(0..-1), :padding => [2, 10, 2, 10], :borders => [])
  style(row(4), padding: [12, 10], :font_style => :bold)
  style(columns(1..3), :align => :right)
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top