3
votes

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)"]]

table(table1)

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

1

1 Answers

11
votes

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