eicca / rtf-templater

Embedded ruby for RTF documents. You provide .rtf template and data and rtf-templater generates the document.
MIT License
22 stars 0 forks source link

Support for Tables in RTF #1

Open sathish316 opened 12 years ago

sathish316 commented 12 years ago

Is it possible to generate table in RTF with dynamic rows and cols?

eicca commented 12 years ago

Hello

No, unfortunately it can not be done.

The problem is that the table will generate an empty row, in which control structure has been placed.

I think there may be a simple workaround, e.g. the row with control structure can be removed after template processing.

I just didn't faced with such problem, so I can't help with that.

sathish316 commented 12 years ago

I didn't get the empty row part.

If i'm willing to ignore the empty rows and use tables for formatting, Is it possible to dynamically generate a MxN table in RTF like the equivalent of adding M TR tags and N TD tags in html?

eicca commented 12 years ago

I played around with the generation of tables. The rows are generated normally, but cols generation does not work. So, you can generate a table only with dynamic number of rows, like:

--------------------------------------
|<% 5.times do %> col1 | col2 | col3 |
--------------------------------------
<% end %>