Class Terminal::Table::Style
In: lib/terminal-table/style.rb
Parent: Object

A Style object holds all the formatting information for a Table object

To create a table with a certain style, use either the constructor option :style, the Table#style object or the Table#style= method

All these examples have the same effect:

    # by constructor
    @table = Table.new(:style => {:padding_left => 2, :width => 40})

    # by object
    @table.style.padding_left = 2
    @table.style.width = 40

    # by method
    @table.style = {:padding_left => 2, :width => 40}

To set a default style for all tables created afterwards use Style.defaults=

    Terminal::Table::Style.defaults = {:width => 80}

Methods

apply   defaults   defaults=   new   on_change  

Attributes

alignment  [RW] 
all_separators  [RW] 
border_bottom  [RW] 
border_i  [RW] 
border_top  [RW] 
border_x  [RW] 
border_y  [RW] 
margin_left  [RW] 
padding_left  [RW] 
padding_right  [RW] 
width  [RW] 

Public Class methods

Public Instance methods

[Validate]