* Apply a single border to a element from a line node.
( td: HTMLElement, tcPr: SafeXmlNode, lineName: string, cssProp: 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight', ctx: RenderContext )
| 585 | * Apply a single border to a <td> element from a line node. |
| 586 | */ |
| 587 | function applyBorder( |
| 588 | td: HTMLElement, |
| 589 | tcPr: SafeXmlNode, |
| 590 | lineName: string, |
| 591 | cssProp: 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight', |
| 592 | ctx: RenderContext |
| 593 | ): void { |
| 594 | const ln = tcPr.child(lineName) |
| 595 | if (!ln.exists()) return |
| 596 | |
| 597 | // Check for noFill — explicitly clear any border set by table style |
| 598 | const noFill = ln.child('noFill') |
| 599 | if (noFill.exists()) { |
| 600 | td.style[cssProp] = 'none' |
| 601 | return |
| 602 | } |
| 603 | |
| 604 | const style = resolveLineStyle(ln, ctx) |
| 605 | if (style.width > 0 && style.color !== 'transparent') { |
| 606 | td.style[cssProp] = `${Math.max(style.width, 0.5)}px ${style.dash} ${style.color}` |
| 607 | } |
| 608 | } |
no test coverage detected