Skip to content

Custom top and bottom table style #218

Description

@manoelmozzer

First, thanks for the great library. It is excellent.

It would be nice to be able to customize the first and last rows of the table different from the middle ones.

From what I've seen, MiddleHorizontal (t.Style().Box.MiddleHorizontal) controls the style of all horizontal lines. However, it would be nice to have independent Top and Bottom options.

These options could generate the following tables, which I didn't get in the current settings:

   #   FIRST NAME   LAST NAME   SALARY                                  <- no top line
----- ------------ ----------- -------- -----------------------------
   1   Arya         Stark         3000                               
  20   Jon          Snow          2000   You know nothing, Jon Snow! 
 300   Tyrion       Lannister     5000                               
----- ------------ ----------- -------- -----------------------------
                    TOTAL        10000                               
----- ------------ ----------- -------- ----------------------------- <- with bottom line
=====+============+===========+========+============================= <- diferrent styles
   # | FIRST NAME | LAST NAME | SALARY |                             
-----+------------+-----------+--------+----------------------------- <- diferrent styles
   1 | Arya       | Stark     |   3000 |                             
  20 | Jon        | Snow      |   2000 | You know nothing, Jon Snow! 
 300 | Tyrion     | Lannister |   5000 |                             
-----+------------+-----------+--------+-----------------------------
     |            | TOTAL     |  10000 |                             
=====+============+===========+========+=============================
^^^^^+^^^^^^^^^^^^+^^^^^^^^^^^+^^^^^^^^+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <- diferrent styles
   # | FIRST NAME | LAST NAME | SALARY |                             
-----+------------+-----------+--------+----------------------------- <- diferrent styles
   1 | Arya       | Stark     |   3000 |                             
  20 | Jon        | Snow      |   2000 | You know nothing, Jon Snow! 
 300 | Tyrion     | Lannister |   5000 |                             
-----+------------+-----------+--------+-----------------------------
     |            | TOTAL     |  10000 |                             
~~~~~+~~~~~~~~~~~~+~~~~~~~~~~~+~~~~~~~~+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <- diferrent styles

With this feature, custom styles would become more generic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions