Fine-tune cable appearance

Add hack to make manufacturer / part number row have vertical separators, to be visually consistent with connectors.

In the future, connectors will have to be modified to be HTML tables instead of GraphViz record nodes, in order to support colored bands for the connector, or individual pins (#53). When this is implemented, a cleaner solution should be found for both connectors and cables.
This commit is contained in:
Daniel Rojas 2020-07-02 19:09:27 +02:00
parent 65a4d6bd07
commit 16929687d3

View File

@ -158,9 +158,11 @@ class Harness:
if cable.show_name:
html = f'{html}<tr><td colspan="{len(attributes)}">{cable.name}</td></tr>'
if(len(identification) > 0): # print an identification row if values specified
html = f'{html}<tr><td colspan="{len(attributes)}"><table border="0" cellspacing="0" cellpadding="0" cellborder="0"><tr>'
for attrib in identification:
html = f'{html}<td>{attrib}</td>'
html = f'{html}<tr><td colspan="{len(attributes)}" cellpadding="0"><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr>'
for attrib in identification[0:-1]:
html = f'{html}<td sides="R">{attrib}</td>' # all columns except last have a border on the right (sides="R")
if len(identification) > 0:
html = f'{html}<td border="0">{identification[-1]}</td>' # last column has no border on the right because the enclosing table borders it
html = f'{html}</tr></table></td></tr>' # end identification row
html = f'{html}<tr>' # attribute row
for attrib in attributes: