Skip to content

Commit 18f42d9

Browse files
committed
feature(table): modify table cell borders
1 parent e74192d commit 18f42d9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/helper/xml-elements.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,35 @@ export default class XmlElements {
110110
idx.setAttribute('val', String(0))
111111
return idx
112112
}
113+
114+
cellBorder(tag:'lnL'|'lnR'|'lnT'|'lnB'): this {
115+
const border = this.document.createElement(tag);
116+
117+
border.appendChild(this.solidFill());
118+
border.appendChild(this.prstDash());
119+
border.appendChild(this.round());
120+
border.appendChild(this.lineEnd('headEnd'));
121+
border.appendChild(this.lineEnd('tailEnd'));
122+
123+
return this;
124+
}
125+
126+
prstDash() {
127+
const prstDash = this.document.createElement('a:prstDash')
128+
prstDash.setAttribute('val', 'solid')
129+
return prstDash
130+
}
131+
132+
round() {
133+
const round = this.document.createElement('a:round')
134+
return round
135+
}
136+
137+
lineEnd(type:'headEnd'|'tailEnd') {
138+
const lineEnd = this.document.createElement(type)
139+
lineEnd.setAttribute('type', 'none')
140+
lineEnd.setAttribute('w', 'med')
141+
lineEnd.setAttribute('len', 'med')
142+
return lineEnd
143+
}
113144
}

0 commit comments

Comments
 (0)