diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index b989dce4..db8106ce 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -172,23 +172,25 @@ def create_graph(self) -> Graph: f'{cable.length} m' if cable.length > 0 else ''] attributes = list(filter(None, attributes)) - html = '' # name+attributes table + html = '
' # main table - - html = f'{html}' # name+attributes table - if cable.show_name: - html = f'{html}' - if(len(identification) > 0): # print an identification row if values specified - html = f'{html}' # end identification row - html = f'{html}' # attribute row - for attrib in attributes: - html = f'{html}' - html = f'{html}' # attribute row - html = f'{html}
{cable.name}
' - for attrib in identification[0:-1]: - html = f'{html}' # all columns except last have a border on the right (sides="R") - if len(identification) > 0: - html = f'{html}' # last column has no border on the right because the enclosing table borders it - html = f'{html}
{attrib}{identification[-1]}
{attrib}
' # main table + + if cable.show_name or len(attributes) > 0: + html = f'{html}' # name+attributes table html = f'{html}' # spacer between attributes and wires
' # name+attributes table + if cable.show_name: + html = f'{html}' + if(len(identification) > 0): # print an identification row if values specified + html = f'{html}' # end identification row + if(len(attributes) > 0): + html = f'{html}' # attribute row + for attrib in attributes: + html = f'{html}' + html = f'{html}' # attribute row + html = f'{html}
{cable.name}
' + for attrib in identification[0:-1]: + html = f'{html}' # all columns except last have a border on the right (sides="R") + if len(identification) > 0: + html = f'{html}' # last column has no border on the right because the enclosing table borders it + html = f'{html}
{attrib}{identification[-1]}
{attrib}