From 40fa0ed846b5f10ffa9d3407efddcd2595eac71e Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 23 Aug 2017 00:08:30 +0200 Subject: [PATCH] jp (common): fixed empty table display when headers are specified --- frontends/src/jp/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontends/src/jp/common.py b/frontends/src/jp/common.py index b6fbc875..4a78988c 100644 --- a/frontends/src/jp/common.py +++ b/frontends/src/jp/common.py @@ -555,6 +555,10 @@ class Table(object): raise exceptions.DataError(u'rows size is not coherent') self.rows.append(new_row) + if not data and headers is not None: + # the table is empty, we print headers at their lenght + self.sizes = [len(h) for h in headers] + @staticmethod def readDictValues(data, keys, defaults=None): if defaults is None: