开发者

How to set the column_width for table while using rails prawn?

开发者 https://www.devze.com 2023-01-19 11:57 出处:网络
This is my prawn code table1 = [[\"Time duration selected\", \"Driving Time\", \"Stop Time\", \"Productivity\", \"Stop Count\", \"Max Speed (km/h)\", \"Average Speed (km/h)\", \"Distance Travelled (

This is my prawn code

table1 = [["Time duration selected", "Driving Time", "Stop Time", "Productivity", "Stop Count", "Max Speed (km/h)", "Average Speed (km/h)", "Distance Travelled (km)"]]

tab开发者_运维知识库le(table1)

This code creates a row.. But i need to specify column width here... so how to set the column width?


Two ways width can be mentioned.

First, table tablename,:column_widths => {0 => 70,1 => 60,2 => 60,3 => 60,4 => 60,5 => 70,6 => 70,7 => 70}

This table contains 8 columns.

Secondly, you set the width of the whole table table tablename,:width => 350

0

精彩评论

暂无评论...
验证码 换一张
取 消