We're getting markdown tables! I assume this is what they look like:
data data data data --------------------- | | | | | | | |
Your task is to make a program or function to generate one of these tables. You'll be given input (string, list of lines, list of characters, etc.) containing data, which looks like this:
datadata data data data data data data
The data consists of spaces and non-overlapping
datas. The data will not necessarily form neat stacks (it can float in midair). There is guaranteed to be data on the top and bottom lines, as well as some touching the left side. You can choose if the data is right padded with spaces or not.
The table will always be six characters wider than the data, padded three spaces on the left. The table top is directly below the bottom row of data, and is made up of a line of
As for the legs, everyone knows taller tables can support more weight, so they'll need to be one unit tall for every
data in the input. They will be made up of
|s, one space in from the sides.
This is code-golf, so shortest answer in bytes per language wins!
data ---------- | |
data data data data data data
data data data data data data --------------------- | | | | | | | | | | | |
data data ---------- | | | |