Skip to content

Repeating Code #768

Answered by girlpunk
Guilherme-Cassel asked this question in Q&A
Jan 26, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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");
        });
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Guilherme-Cassel
Comment options

Answer selected by Guilherme-Cassel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants