Robpol86 / terminaltables

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

Tables in tables #19

Open awakeford opened 8 years ago

awakeford commented 8 years ago

Hi,

Doesn't seem to support tables in tables. I tried:

table = SingleTable(table_data,"Work logs") outer_table = SingleTable([[""],[table.table]],"outer") print outer_table.table

But got the following table, not sure if this will show correctly but the issue is that the "outer" right hand column lines are not in-line for the rows where the second table is inserted.

This doesn't make much sense to me as the second table is just a string with '\n' in it is it not? So it should be able to figure out the "width" of the inner table but doesn't seem to calculate it correctly.

┌outer────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                 │
├─────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ┌Work logs──────┬─────────────────────────────────────────┬───────────┐             │
│ │ author        │ comment                                 │ timeSpent │ │
│ ├───────────────┼─────────────────────────────────────────┼───────────┤                   │
│ │ Alan Wakeford │ Review ODUC_MUX vplan (TP + initial TC) │ 1d        │ │
│ └───────────────┴─────────────────────────────────────────┴───────────┘                   │
└─────────────────────────────────────────────────────────────────────────────────────────────────┘