在大虾中使用列表 [英] Using lists in prawn

查看:47
本文介绍了在大虾中使用列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 prawn 创建包含大量表格格式数据和一些列表的 pdf.列表的问题在于,我只是使用文本作为列表,因为没有语义等价于 ul > li 列表,就像我在 web 前端使用它们一样.所以这些列表是不合理的.使用多条线的列表点看起来很糟糕,因为我不适合列表图标.如何在 prawn 中实现看起来不像废话的列表?

Im using prawn to create pdfs that contain much data in table format and some lists. The problem with the lists is that Im just using text as lists because there is no semantic equivalent to ul > li lists like I use them in the webfrointend. So the lists arent justified. A list point that uses more than one line looks creapy because I doesnt fit the list icon. How can I implement lists in prawn that dont look like crap?

推荐答案

Prawn 是一个很好的 PDF 库,但问题在于它自己的视图系统.有 Prawn-format 但不再维护.

Prawn was a good PDF library but the problem is its own view system. There is Prawn-format but is not maintained anymore.

我建议使用 WickedPDF,它允许您在 PDF 中包含简单的 ERB 代码.

I suggest to use WickedPDF, it allows you to include simple ERB code in your PDF.

Using Prawn:另一个又脏又丑的解决方案是一个两列的表无边框,第一列包含列表项目符号,第二列包含文本:

Using Prawn: another dirty and ugly solution is a two column table without border, first column contains list-bullet, second column text:

table([ ["•", "First Element"],
        ["•", "Second Element"],
        ["•", "Third Element"] ])

这篇关于在大虾中使用列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆