大虾使用rails时如何设置table的column_width?

发布于 2024-09-26 18:39:05 字数 269 浏览 1 评论 0原文

这是我的大虾代码

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 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

抽个烟儿 2024-10-03 18:39:05

可以通过两种方式提及宽度。

首先,table 表名,:column_widths => {0 =>; 70,1=> 60,2=> 60,3=> 60,4=> 60,5=> 70,6=> 70,7=> 70}

该表包含 8 列。

其次,你设置整个表格的宽度table tablename,:width => 350

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文