The function has only one parameter:
data
- a list
of all the data the table will contain in this format:
[
['C1R1', 'C1R2', 'C1R3'],
['C2R1', 'C2R2', 'C2R3'],
['C3R1', 'C3R2', 'C3R3']
]
The resulting table should look something like this:
+------+------+------+
| C1R1 | C1R2 | C1R3 |
+------+------+------+
| C2R1 | C2R2 | C2R3 |
+------+------+------+
| C3R1 | C3R2 | C3R3 |
+------+------+------+
It will convert any kind of data to a string using Python
's str()
method.
It should be able to handle varying lengths as well since it decides the width of each column individually.
So the input
:
[
['**C1R1**', 'C1R2', 'C1R3'],
['C2R1', 'C2R2', '*C2R3*'],
['*C3R1*', 'C3R2', 'C3R3']
]
Should output
as:
+----------+------+--------+
| **C1R1** | C1R2 | C1R3 |
+----------+------+--------+
| C2R1 | C2R2 | *C2R3* |
+----------+------+--------+
| *C3R1* | C3R2 | C3R3 |
+----------+------+--------+