1 //! This example demonstrates evolving the standard [`Builder`] to an [`IndexBuilder`],
2 //! and then manipulating the constructing table with a newly prepended index column.
4 //! * An [`IndexBuilder`] is capable of several useful manipulations, including:
5 //! * Giving the new index column a name
6 //! * Transposing the index column around a table
7 //! * Choosing a location for the new index column besides 0; the default
9 //! * Note that like with any builder pattern the [`IndexBuilder::build()`] function
10 //! is necessary to produce a displayable [`Table`].
12 use tabled
::{settings::Style, Table, Tabled}
;
17 based_on
: &'
static str,
23 fn new(name
: &'
static str, based_on
: &'
static str, is_active
: bool
, is_cool
: bool
) -> Self {
35 Distribution
::new("Manjaro", "Arch", true, true),
36 Distribution
::new("Arch", "None", true, true),
37 Distribution
::new("Debian", "None", true, true),
40 let mut table
= Table
::builder(data
)
47 table
.with(Style
::modern());