Crate papergrid[][src]

Expand description

Papergrid is a library for generating text-based tables for display

Example

    use papergrid::{Grid, Entity, Settings, DEFAULT_CELL_STYLE};
    let mut grid = Grid::new(2, 2);
    grid.set_cell_borders(DEFAULT_CELL_STYLE.clone());

    grid.set(&Entity::Cell(0, 0), Settings::new().text("0-0"));
    grid.set(&Entity::Cell(0, 1), Settings::new().text("0-1"));
    grid.set(&Entity::Cell(1, 0), Settings::new().text("1-0"));
    grid.set(&Entity::Cell(1, 1), Settings::new().text("1-1"));

    let expected = concat!(
        "+---+---+\n",
        "|0-0|0-1|\n",
        "+---+---+\n",
        "|1-0|1-1|\n",
        "+---+---+\n",
    );

    assert_eq!(expected, grid.to_string());

Structs

Grid provides a set of methods for building a text-based table

Settings represent setting of a particular cell

Enums

AlignmentHorizontal represents an horizontal aligment of a cell content.

AlignmentVertical represents an vertical aligment of a cell content.

Entity a structure which represent a set of cells.

Constants

Functions