
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Add this line to your application's Gemfile:
gem 'termtable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install termtable
A table instance can take a 2 dimensional array for the rows.
table = Termtable::Table.new [[1, 2, 3], [4, 5, 6]]
This can also be given as a hash with a rows key.
table = Termtable::Table.new rows: [[1, 2, 3], [4, 5, 6]]
puts table.render
+--+--+--+
|1 |2 |3 |
|4 |5 |6 |
+--+--+--+
Headers can be given as the first array
Termtable::Table.new ['Header A', 'Header B'], [['a1', 'a2'], ['b1', 'b2']]
Also as a headers key
Termtable::Table.new headers: ['Header A', 'Header B'], rows: [['a1', 'a2'], ['b1', 'b2']]
+---------+---------+
|Header A |Header B |
+---------+---------+
|a1 |a2 |
|b1 |b2 |
+---------+---------+
It is possible to pass a padding argument to the render method
table = Termtable::Table.new rows: [['a1', 'a2'], ['b1', 12345]]
puts table.render(padding: 3)
+-----+--------+
|a1 |a2 |
|b1 |12345 |
+-----+--------+
It is possible to pass an alignment argument to render
table = Termtable::Table.new rows: [['a1', 'a2'], ['b1', 123456]]
puts table.render(alignment: 'center')
+----+--------+
| a1 | a2 |
| b1 | 123456 |
+----+--------+
To run the tests
$ rake
Bug reports and pull requests are welcome on GitHub at https://github.com/nikkypx/termtable.
FAQs
Unknown package
We found that termtable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.