Skip to content

Instantly share code, notes, and snippets.

@bradediger
Created February 26, 2011 16:20
Show Gist options
  • Select an option

  • Save bradediger/845356 to your computer and use it in GitHub Desktop.

Select an option

Save bradediger/845356 to your computer and use it in GitHub Desktop.
Prawn::Document.generate "conditional_formatting.pdf" do |pdf|
data = [["foo", "bar"],
["", "baz"]]
pdf.table(data) do |t|
t.column(1).style do |c|
if t.cells[c.row, 0].content.empty?
c.text_color = "ff0000"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment