2011-09-14 132 views
0
**I want to insert a table inside a parent table column.** 

e.g :- 
    <table> 
     <tr> 
     <th> Type </th> 
     <th> Rate </th> 
     <th> Duration </th> 
     </tr> 
     <tr> 
     <td> Time <br/> 
     <table> 
      <tr> 
      <th> Name</th> 
      <th> Rate </th> 
      <th> Duration </th> 
      </tr> 
      <tr> 
      <td> Tom </td> 
      <td> $100 </td> 
      <td> 25 </td> 
     </tr> 
     <tr> 
      <td> Tom1 </td> 
      <td> $200 </td> 
      <td> 20 </td> 
     </tr> 
     <tr> 
      <td> Tom2 </td> 
      <td> $300 </td> 
      <td> 26 </td> 
     </tr> 
     </table> 
     </td> 
     <td> $1000</td> 
     <td> 65 </td> 
    </tr> 
    </table> 

This is in html format . I want to display content in the same format in pdf using prawn. 

回答

0

您是否嘗試過使用WickedPDF。這是一個PDF生成工具,但你寫的HTML而不是學習新的語法等。它還有能夠使用Webkit語法的額外好處,因此HTML5是貫穿整個

+0

**感謝您的建議。使用大蝦可以在代碼中使用html語法。它在數組中標識\ n和\ t。因此它可以識別表格標籤。** –

+0

WickedPDF表格標題不能在每個頁面中重複。 ** act_as_flying_saucer ** gem適用於pdf的生成,並基於java。結帳此鏈接** https://github.com/amardaxini/acts_as_flying_saucer** –