Próbuję wyeksportować docx w react w taki sposób by wszystko było wyśrodkowane w pionie w każdym rzędzie, wie ktoś jak to zrobić? W rezultacie tekst znajduje się na dole linii.
const rows = [];
for (const item of items) {
const blob = await fetch(item.Image).then((r) => r.blob());
const arrayBuffer = await new Response(blob).arrayBuffer();
const uint8Array = new Uint8Array(arrayBuffer);
const paragraph = new Paragraph({
children: [
new ImageRun({
data: uint8Array,
transformation: { width: 50, height: 50 },
}),
new TextRun({
text: `\t${item.Title}\t`,
style: {
verticalAlign: 'center', // Wyrównanie tekstu do środka wertykalnie
lineHeight: 50,
} as any,
}),
new TextRun({
text: `${item.Meaning}\n`,
}),
],
});
rows.push(paragraph);
}
const doc = new Document({
sections: [
{
children: [
...rows,
],
},
],