ascii-table icon indicating copy to clipboard operation
ascii-table copied to clipboard

Heading not respected when there are fewer columns

Open atsepkov opened this issue 8 years ago • 0 comments

Consider the following use case:

  • heading has 3 items
  • the only row in the table has 1 item In this case the table will only render a single heading and a single column, ignoring the remaining headings rather than rendering the other 2 columns as blank

Now consider the case when there are more than one row and some rows are not filled to 3 items. In this case the omitted columns will be rendered as empty rather than being dropped for rows that do have them.

Case 2 and case 1 contradict each other in terms of behavior. Case 2 makes sense to me, case 1 does not. If the heading is specified, I expect the column to render. Could this edge case be fixed? Or, perhaps if this behavior is desired in some cases add a flag to the table that tells it whether to render or omit empty columns.

atsepkov avatar Aug 12 '16 01:08 atsepkov