Skip to content

Border is a string instead of a number in demo_tables.mjs #1389

@hesi726

Description

@hesi726

genSlide02 function in demo_tables.mjs

       // BTM-LEFT
	let tabOpts3 = {
		x: 0.5,
		y: 5.15,
		w: 6.0,
		h: 2,
		margin: 0.05,
		align: "center",
		valign: "middle",
		fontSize: 16,
		border: { pt: "2", color: pptx.colors.TEXT2 },
		fill: { color: "F1F1F1" },
	};
	let arrTabRows3 = [
		[
			{ text: "A1\nA2\nA3", options: { rowspan: 3, fill: { color: pptx.colors.ACCENT6 } } },
			{ text: "B1\nB2", options: { rowspan: 2, fill: { color: pptx.colors.ACCENT2 } } },
			{ text: "C1", options: { fill: { color: pptx.colors.ACCENT4 } } },
		],
		[{ text: "C2", options: { fill: { color: pptx.colors.ACCENT4 } } }],
		[{ text: "B3 -> C3", options: { colspan: 2, fill: { color: pptx.colors.ACCENT5 } } }],
	];
	slide.addTable(arrTabRows3, tabOpts3);

the border will be 1 and not 2;

for the follow code in addTableDefinition function in gen-object.ts.

// set complete BorderOptions for all sides
				const arrSides = [0, 1, 2, 3]
				arrSides.forEach(idx => {
					newCell.options.border[idx] = {
						type: newCell.options.border[idx].type || DEF_CELL_BORDER.type,
						color: newCell.options.border[idx].color || DEF_CELL_BORDER.color,
						pt: typeof newCell.options.border[idx].pt === 'number' ? newCell.options.border[idx].pt : DEF_CELL_BORDER.pt,
					}
				})

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions