open source – C or C++ library for drawing tables or grids on the terminal


I need to draw tables – or, if you will, grids – on a terminal, with features including:

  • Drawing of the gridlines
  • Coordinates printed outside the table axes
  • Arbitrary ranges on each axis
  • Ability to specify table contents so that not all cells have contents
  • Allowance for more or less space within cells
  • Indication of axis names
  • Support for strings inside cells (but possibly also integers and floating-point values passed directly)

Example:

X\Y    3    4
    +----+----+
 99 | 15 |    |
    +----+----+
 98 |  9 |    |
    +----+----+
 97 | 10 | 11 |
    +----+----+

Now, obviously there are C libraries which print some of the elements of such a table to the terminal, but – are there libraries which print entire tables, and support most or all of these features?

Requirements:

  • Language: C or C++
  • OS support: Linux at least
  • Few or no dependencies beyond the language’s standard library
  • Libre
  • Gratis



Source link

Related Posts

About The Author

Add Comment