Robpol86 / terminaltables

Project no longer maintained.
https://github.com/matthewdeanmartin/terminaltables
MIT License
689 stars 70 forks source link

[enhancement] option to use `=` on `inner_heading_row_border` #38

Closed ickc closed 7 years ago

ickc commented 7 years ago

Feature request: option to use = on inner_heading_row_border

e.g.

+-------+------+---------+--------+
| head  | head | header  | header |
+=======+======+=========+========+
| 12    | 12   | 12      | 12     |
+-------+------+---------+--------+
| 123   | 123  | 123     | 123    |
+-------+------+---------+--------+
| 1     | 1    | 1       | 1      |
+-------+------+---------+--------+

Similarly for inner_footing_row_border.

examples used by other plain text tables:

Robpol86 commented 7 years ago

I believe you can accomplish this already:

>>> from terminaltables import AsciiTable
>>> table_data = [
... ['head', 'head', 'header', 'header'],
... [12,12,12,12],
... [123,123,123,123],
... [1,1,1,1],
... ]
>>> table = AsciiTable(table_data)
>>> table.inner_heading_row_border = True
>>> table.inner_row_border = True
>>> table.CHAR_H_INNER_HORIZONTAL = '='
>>> print(table.table)
+------+------+--------+--------+
| head | head | header | header |
+======+======+========+========+
| 12   | 12   | 12     | 12     |
+------+------+--------+--------+
| 123  | 123  | 123    | 123    |
+------+------+--------+--------+
| 1    | 1    | 1      | 1      |
+------+------+--------+--------+
>>> 
ickc commented 7 years ago

My bad, didn't see that method! Sorry, I'm closing it.

By the way, I personally want to use it as a CLI, so I wrote a very short script that import yours. Are you interested in providing a CLI?

Robpol86 commented 7 years ago

What do you mean CLI? Is it similar to https://github.com/Robpol86/terminaltables/issues/10 ?