pub fn new(strs: &'a [S], mut sizes: Option<&'a [usize]>,
            horizontal: bool) -> Table<'a, S> {
        if let Some(sz) = sizes {
            if sz.is_empty() {
                sizes = None;
            }
        }

        let n_strs = strs.len();
        let n_cols = sizes.map_or(1, |sz| sz.len());

        let rows = n_strs / n_cols + (n_strs % n_cols != 0) as usize;

        Table{
            strings: strs,
            sizes: sizes,
            offset: 0,
            per_col: (strs.len() + (n_cols - 1)) / n_cols,
            rows: rows,
            horizontal: horizontal,
        }
    }
/// Constructs a new table from the given set of strings, using the given
/// column sizes.
///
/// If `horizontal` is `true`, items will be list horizontally first.
///
/// # Horizontal
///
/// ```text
/// a b c
/// d e f
/// g h i
/// ```
///
/// # Vertical
///
/// ```text
/// a d g
/// b e h
/// c f i
/// ```
Constructs a new table from the given set of strings, using the given
column sizes.

If `horizontal` is `true`, items will be list horizontally first.
Constructs a new table from the given set of strings using the given column sizes . If ` horizontal ` is ` true ` items will be list horizontally first .
pub fn new(strs: &'a [S], mut sizes: Option<&'a [usize]>,
            horizontal: bool) -> Table<'a, S> {
        if let Some(sz) = sizes {
            if sz.is_empty() {
                sizes = None;
            }
        }
        let n_strs = strs.len();
        let n_cols = sizes.map_or(1, |sz| sz.len());
        let rows = n_strs / n_cols + (n_strs % n_cols != 0) as usize;
        Table{
            strings: strs,
            sizes: sizes,
            offset: 0,
            per_col: (strs.len() + (n_cols - 1)) / n_cols,
            rows: rows,
            horizontal: horizontal,
        }
    }
pub fn new ( strs : & ' a [ S ] , mut sizes : Option < & ' a [ usize ] > , horizontal : bool ) -> Table < ' a , S > { if let Some ( sz ) = sizes { if sz . is_empty ( ) { sizes = None ; } } let n_strs = strs . len ( ) ; let n_cols = sizes . map_or ( 1 , | sz | sz . len ( ) ) ; let rows = n_strs / n_cols + ( n_strs % n_cols != 0 ) as usize ; Table { strings : strs , sizes : sizes , offset : 0 , per_col : ( strs . len ( ) + ( n_cols - 1 ) ) / n_cols , rows : rows , horizontal : horizontal , } }
Constructs a new table from the given set of strings, using the given
column sizes.
Constructs a new table from the given set of strings using the given column sizes .
strs
&'a [S]
sizes
Option<&'a [usize]>
horizontal
bool
strs
&'a [S]
sizes
Option<&'a [usize]>
horizontal
bool
horizontal
```text
a b c
d e f
g h i
```
` ` ` text a b c d e f g h i ` ` `
vertical
```text
a d g
b e h
c f i
```
` ` ` text a d g b e h c f i ` ` `