libfort/examples/3-complex_layout.cpp

36 lines
981 B
C++
Raw Normal View History

2019-09-22 09:18:15 +02:00
#include <iostream>
#include "fort.hpp"
int main()
{
2019-09-28 10:02:34 +02:00
fort::char_table table;
2019-09-22 09:18:15 +02:00
/* Set table border style */
table.set_border_style(FT_DOUBLE2_STYLE);
// Fill table with data
table << fort::header
<< "Sed" << "Aenean" << "Text" << fort::endr;
table << "Duis" << "Aliquam"
<< "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
"In accumsan felis eros, nec malesuada sapien bibendum eget."
<< fort::endr;
table << "Mauris" << "Curabitur"
<< "Proin condimentum eros viverra nunc ultricies, at fringilla \n"
"quam pellentesque."
<< fort::endr;
table << "Summary" << ""
<< "Sed tempor est eget odio varius dignissim."
<< fort::endr;
table[0][2].set_cell_text_align(fort::text_align::center);
table[3][0].set_cell_text_align(fort::text_align::center);
table[3][0].set_cell_span(2);
std::cout << table.to_string() << std::endl;
}