Comments (4)
Thanks for using the library!
It has some rough edges still, auto resizing is one of them. However, you should be able to flip the orientation:
table = TTY::Table.new ..... orientation: :vertical
from tty-table.
@peter-murach thanks for quick response
Just tried as you said, but something odd is happening
>> x = []
=> []
>> 2000.times{ |i| x <<i }
=> 2000
>> require 'tty-table'
=> true
>> table = TTY::Table.new [x, x], orientation: :vertical
=> #<TTY::Table header=nil rows=[#<TTY::Table::Row fields=["1", 0]>, #<TTY::Table::Row fields=["2", 1]>, #<TTY::Table::Row fields=["3", 2]>, #<TTY::Table::Row fields=["1", 0]>, #<TTY::Table::Row fields=["2", 1]>, #<TTY::Table::Row fields=["3", 2]>] orientation=#<TTY::Table::Orientation::Vertical:0x007fd439cd1530 @name=:vertical> original_rows=2 original_columns=2000>
>> puts table
1 0
2 1
3 2
1 0
2 1
3 2
=> nil
from tty-table.
I have a similar issue. The vertical rotate is nice. But if my terminal is too small and resize is set to true, I get the NoMethodError: undefined method 'rindex' for nil:NilClass in truncate. I would be in favor of either throw an something that force to turn of resize true, or send a message to the user the table is to big for the terminal and need to be expanded or switch the resize to false to have vertical row..
from tty-table.
Full backtrace for the resize: true
bug when the terminal width is too small for a column:
NoMethodError: undefined method `rindex' for nil:NilClass
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/verse-0.5.0/lib/verse/truncation.rb:71:in `truncate'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/verse-0.5.0/lib/verse/truncation.rb:36:in `truncate'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/verse-0.5.0/lib/verse.rb:47:in `truncate'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operation/truncation.rb:38:in `call'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:65:in `block (4 levels) in run_operations'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:64:in `each'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:64:in `block (3 levels) in run_operations'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:63:in `each'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:63:in `block (2 levels) in run_operations'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:61:in `each'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:61:in `each_with_index'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:61:in `block in run_operations'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:60:in `each'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:60:in `each_with_index'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/operations.rb:60:in `run_operations'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/renderer/basic.rb:203:in `render'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/renderer.rb:96:in `render'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table/renderer.rb:77:in `render_with'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table.rb:451:in `render_with'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/tty-table-0.9.0/lib/tty/table.rb:425:in `render'
/home/kontena/kontena/kontena/cli/lib/kontena/cli/table_generator.rb:74:in `render'
/home/kontena/kontena/kontena/cli/lib/kontena/cli/table_generator.rb:35:in `generate_table'
/home/kontena/kontena/kontena/cli/lib/kontena/cli/table_generator.rb:39:in `print_table'
/home/kontena/kontena/kontena/cli/lib/kontena/cli/containers/list_command.rb:25:in `execute'
/home/kontena/kontena/kontena/cli/lib/kontena/command.rb:216:in `run'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/clamp-1.2.1/lib/clamp/subcommand/execution.rb:11:in `execute'
/home/kontena/kontena/kontena/cli/lib/kontena/command.rb:216:in `run'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/clamp-1.2.1/lib/clamp/subcommand/execution.rb:11:in `execute'
/home/kontena/kontena/kontena/cli/lib/kontena/command.rb:216:in `run'
/home/kontena/kontena/kontena/cli/vendor/bundle/ruby/2.3.0/gems/clamp-1.2.1/lib/clamp/command.rb:132:in `run'
bin/kontena:22:in `<top (required)>'
from tty-table.
Related Issues (20)
- Rotated table missing line separator HOT 3
- Dependency conflict with tty-prompt `necromancer` HOT 2
- Headless table fails HOT 1
- CSV/JSON/YAML renderers would be nice HOT 1
- How to disable rotating? HOT 1
- border.separator = :each_row HOT 6
- Create table directly from Hash HOT 4
- undefined method `rindex' for nil:NilClass when using resize: true HOT 7
- Multiline render option breaks multi coloured cell data HOT 4
- anyway to add a separator between arbitrary rows? HOT 2
- Dependency conflict on necromancer 0.4.0, tty-screen 0.6.4 HOT 1
- Strange separator inserting
- Please release version with pastel 0.8 dependency HOT 1
- Columns are not rendered when the table width exceeds the currently set width.Defaulting HOT 1
- table.render outputs nothing when used inside Thor HOT 1
- Support for column spanning HOT 2
- Wrong table header width when using TTY::Link
- RangeError: Invalid array length HOT 1
- Top border is not indented correctly when table has no headers HOT 1
- `require 'tty-table' failed with undefined method `gunzip' for Gem:Module` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tty-table.