[F] Fixed the example
This commit is contained in:
parent
a8868e7bd9
commit
78acb23c47
@ -19,9 +19,11 @@
|
|||||||
|
|
||||||
```C
|
```C
|
||||||
#include "fort.h"
|
#include "fort.h"
|
||||||
|
#include "stdio.h"
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
ft_table_t *table = ft_create_table();;
|
ft_table_t *table = ft_create_table();
|
||||||
|
/* Set "header" type for the first row */
|
||||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_COPT_ROW_TYPE, FT_ROW_HEADER);
|
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_COPT_ROW_TYPE, FT_ROW_HEADER);
|
||||||
ft_write_ln(table, "N", "Planet", "Speed, km/s");
|
ft_write_ln(table, "N", "Planet", "Speed, km/s");
|
||||||
|
|
||||||
@ -44,7 +46,7 @@ Output:
|
|||||||
+---+---------+-------------+
|
+---+---------+-------------+
|
||||||
```
|
```
|
||||||
|
|
||||||
<img src="https://github.com/seleznevae/libfort/blob/master/docs/images/basic_table.png" data-canonical-src="https://github.com/seleznevae/libfort/blob/master/docs/images/basic_table.png" width="500" />
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -35,7 +35,8 @@ void print_char_str(const char *str)
|
|||||||
|
|
||||||
void base_example(void)
|
void base_example(void)
|
||||||
{
|
{
|
||||||
ft_table_t *table = ft_create_table();;
|
ft_table_t *table = ft_create_table();
|
||||||
|
/* Set "header" type for the first row */
|
||||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_COPT_ROW_TYPE, FT_ROW_HEADER);
|
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_COPT_ROW_TYPE, FT_ROW_HEADER);
|
||||||
ft_write_ln(table, "N", "Planet", "Speed, km/s");
|
ft_write_ln(table, "N", "Planet", "Speed, km/s");
|
||||||
|
|
||||||
|
@ -3896,6 +3896,7 @@ clear:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef FT_HAVE_WCHAR
|
||||||
|
|
||||||
int wprint_row_separator(wchar_t *buffer, size_t buffer_sz,
|
int wprint_row_separator(wchar_t *buffer, size_t buffer_sz,
|
||||||
const size_t *col_width_arr, size_t cols,
|
const size_t *col_width_arr, size_t cols,
|
||||||
@ -4067,7 +4068,7 @@ clear:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
fort_row_t *create_row_from_string(const char *str)
|
fort_row_t *create_row_from_string(const char *str)
|
||||||
{
|
{
|
||||||
|
@ -363,6 +363,7 @@ clear:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef FT_HAVE_WCHAR
|
||||||
|
|
||||||
int wprint_row_separator(wchar_t *buffer, size_t buffer_sz,
|
int wprint_row_separator(wchar_t *buffer, size_t buffer_sz,
|
||||||
const size_t *col_width_arr, size_t cols,
|
const size_t *col_width_arr, size_t cols,
|
||||||
@ -534,7 +535,7 @@ clear:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
fort_row_t *create_row_from_string(const char *str)
|
fort_row_t *create_row_from_string(const char *str)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user