You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd have to review, but I believe in cli-table2 it's a pretty naive implementation that does a merge of the default config, the table config, the the cell config using merge (listed in order of increasing importance).
The way cli-table works is that each cell is responsible for rendering it's own top and left edges. Only cells in the last column render their right edge. Only cells in the last row render their bottom edge. This does not make for very convenient custom characters at the cell level. If you want to change the bottom / right edge of a particular cell, you actually need to find the neighbor responsible for that and set the value there. It would be better if, when deciding what character to use for it's own left edge, a cell checked first for a custom left character in it's own config, if not, check for a custom right character in the config of it's neighbor, and followed by the left character as configured at the table level, followed by the default.
Corners get even more interesting (who gets to take precedence).
I'm not sure how necessary "custom chars" really are. It might be better just to offer the ability to make certain lines "double" or "heavy".
box-chars
box-chars helps pick the correct character for a given edge or intersection
For a standard top left corner character (a character that points down, and to the right), you find it as follows:
varbox=require('box-chars');varleft=box.NOTHING;// nothing pointing to the left from top-left cornervarright=box.LIGHT;// other options are HEAVY or DOUBLEvarup=box.NOTHING;// nothing pointing upvardown=box.LIGHT;box(left,right,up,down);//=> ┌
for situations that do not exist (i.e. right=LIGHT, left=DOUBLE), it picks a sensible default (DOUBLE, DOUBLE in that case).
box-chars is not documented, but it is well tested.
I thought about this and consider this feature to be too much of an edge case. Very few packages will use this feature and it will add a considerable level of complexity to the existing code. As such, it will not be implemented.
This feature is mentioned in https://github.com/jamestalmage/cli-table2 documentation. Though, there is no documentation or examples of it being in use.
@jamestalmage can you share an example?
I don't understand how some of this be possible given that cells share common borders.
The text was updated successfully, but these errors were encountered: