pub fn blockfmt_advanced(
content: impl ToString,
color: Option<Color>,
preset: &str,
arrangement: ContentArrangement,
alignment: CellAlignment,
) -> StringExpand description
Formats content with a border around it
Unless you are looking for something specific, use blockfmt or blockprint.
The border can be created using box-drawing characters, and the content is formatted within the border. The function allows customization of the border’s color, preset, content arrangement, and cell alignment.
§Example
use comfy_table::{presets, CellAlignment, ContentArrangement};
use console::Color;
use libpt_cli::printing::blockfmt_advanced;
println!(
"{}",
blockfmt_advanced(
"Hello world!",
Some(Color::Blue),
presets::UTF8_FULL,
ContentArrangement::DynamicFullWidth,
CellAlignment::Center
)
);┌────────────────────────────────────────────────────────────────────────────────────────┐
│ Hello world! │
└────────────────────────────────────────────────────────────────────────────────────────┘§Parameters
content: The content to be formatted within the bordercolor: The color of the border and textpreset: The preset style for the borderarrangement: The arrangement of the the border (e.g., stretch to sides, wrap around )alignment: The alignment of the content within the cells (e.g., left, center, right)