[C] Modified README
This commit is contained in:
parent
09d0936927
commit
2210722cac
18
README.md
18
README.md
@ -8,6 +8,20 @@
|
|||||||
|
|
||||||
**libfort** is a simple crossplatform library to create formatted text tables.
|
**libfort** is a simple crossplatform library to create formatted text tables.
|
||||||
|
|
||||||
|
<!---
|
||||||
|
╔════════╤═══════════╤══════════════════════════════════════════════════════════════╗
|
||||||
|
║ Sed │ Aenean │ Text ║
|
||||||
|
╠════════╪═══════════╪══════════════════════════════════════════════════════════════╣
|
||||||
|
║ Duis │ Aliquam │ Lorem ipsum dolor sit amet, consectetur adipiscing elit. ║
|
||||||
|
║ │ │ In accumsan felis eros, nec malesuada sapien bibendum eget. ║
|
||||||
|
╟────────┼───────────┼──────────────────────────────────────────────────────────────╢
|
||||||
|
║ Mauris │ Curabitur │ Proin condimentum eros viverra nunc ultricies, at fringilla ║
|
||||||
|
║ │ │ quam pellentesque. ║
|
||||||
|
╟────────┴───────────┼──────────────────────────────────────────────────────────────╢
|
||||||
|
║ Summary │ Sed tempor est eget odio varius dignissim. ║
|
||||||
|
╚════════════════════╧══════════════════════════════════════════════════════════════╝
|
||||||
|
-->
|
||||||
|
|
||||||
**Features:**
|
**Features:**
|
||||||
- Easy to integrate (only 2 files)
|
- Easy to integrate (only 2 files)
|
||||||
- Customization of appearance (various border styles and row/column/cell options for indentation, alignment, padding)
|
- Customization of appearance (various border styles and row/column/cell options for indentation, alignment, padding)
|
||||||
@ -263,3 +277,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|||||||
|
|
||||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BIN
docs/images/carbon2.png
Normal file
BIN
docs/images/carbon2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
@ -47,6 +47,31 @@ void base_example(void)
|
|||||||
ft_destroy_table(table);
|
ft_destroy_table(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void complex_layout_example(void)
|
||||||
|
{
|
||||||
|
ft_table_t *table = ft_create_table();
|
||||||
|
/* Change border style */
|
||||||
|
ft_set_border_style(table, FT_DOUBLE2_STYLE);
|
||||||
|
|
||||||
|
|
||||||
|
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_COPT_ROW_TYPE, FT_ROW_HEADER);
|
||||||
|
ft_write_ln(table, "Sed", "Aenean", "Text");
|
||||||
|
|
||||||
|
ft_write_ln(table, "Duis", "Aliquam",
|
||||||
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
|
||||||
|
"In accumsan felis eros, nec malesuada sapien bibendum eget.");
|
||||||
|
ft_write_ln(table, "Mauris", "Curabitur",
|
||||||
|
"Proin condimentum eros viverra nunc ultricies, at fringilla \n"
|
||||||
|
"quam pellentesque.");
|
||||||
|
ft_write_ln(table, "Summary", "", "Sed tempor est eget odio varius dignissim.");
|
||||||
|
|
||||||
|
ft_set_cell_option(table, 0, 2, FT_COPT_TEXT_ALIGN, FT_ALIGNED_CENTER);
|
||||||
|
ft_set_cell_option(table, 3, 0, FT_COPT_TEXT_ALIGN, FT_ALIGNED_CENTER);
|
||||||
|
ft_set_cell_span(table, 3, 0, 2);
|
||||||
|
printf("%s\n", ft_to_string(table));
|
||||||
|
ft_destroy_table(table);
|
||||||
|
}
|
||||||
|
|
||||||
void different_cell_options_example(void)
|
void different_cell_options_example(void)
|
||||||
{
|
{
|
||||||
ft_table_t *table = ft_create_table();
|
ft_table_t *table = ft_create_table();
|
||||||
@ -95,6 +120,7 @@ int main(void)
|
|||||||
base_example();
|
base_example();
|
||||||
different_cell_options_example();
|
different_cell_options_example();
|
||||||
fill_table_with_data_example();
|
fill_table_with_data_example();
|
||||||
|
complex_layout_example();
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user