Skip to content

Merging multiple tables into one #133

@kajto3

Description

@kajto3

I have 3 tables, each having the same amount of columns, but variable column headers and row amounts.
My goal is to create a single table that looks exactly like 3 tables printed one under another, but I would also like to keep the width of the widest row and headers with their separators/borders.
I keep my tables simplest as possible, this is an example:

 ALLIES     | ping |   xp 
--------------------------
 Statler    |    0 | 1068 
 Stangepork |    0 |  881 
 Scooter    |    0 |  667 
--------------------------
 AXIS     | ping |  xp 
-----------------------
 Wontkins |    0 | 977 
 Snerf    |    0 | 963 
 Animal   |    0 | 659 
-----------------------
 SPECTATOR      | ping | xp 
----------------------------
 SuperPlayerDE  |   48 |  0 
----------------------------

Expected result:

 ALLIES         | ping |   xp 
------------------------------
 Statler        |    0 | 1068 
 Stangepork     |    0 |  881 
 Scooter        |    0 |  667 
------------------------------
 AXIS           | ping |   xp 
------------------------------
 Wontkins       |    0 |  977 
 Snerf          |    0 |  963 
 Animal         |    0 |  659 
------------------------------
 SPECTATOR      | ping |   xp 
------------------------------
 SuperPlayerDE  |   48 |    0 
------------------------------

Another acceptable solution would be to keep 3 tables but somehow set a min width based on the widest row.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions