Repeating Code #768
Answered
by
girlpunk
Guilherme-Cassel
asked this question in
Q&A
Repeating Code
#768
-
It looks like some code parts of QuestPDF are supposed to be repeated every item, but look at this example I made here am I doing it right? you can see I have to repeat ".Border(1).AlignCenter().AlignMiddle().FontSize(11)" for every item on the row for it to work. |
Beta Was this translation helpful? Give feedback.
Answered by
girlpunk
Jan 26, 2024
Replies: 1 comment 1 reply
-
As a suggestion: public static IContainer MyTableCell(this IContainer container) => container
.Border(1)
.AlignCenter()
.AlignMiddle();
public static void MyTextCell(this IContainer container, string text) => container
.MyTableCell()
.Text(text)
.FontSize(11);
private void TableHeader(IContainer container)
{
container
.Border(1)
.Background("a4efc4")
.Row(row =>
{
row.RelativeItem(3).MyTextCell("Produto");
row.RelativeItem(17).MyTextCell("Descrição");
row.RelativeItem(4).MyTextCell("Qntd");
});
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Guilherme-Cassel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a suggestion: