Table border is not applied apart from single

Hello Team,

i am creating a word table. If I give LineStyle.Single it works and creates the border but I want to give table border as LineStyle.ThinThickSmallGap and it is not working.

var midtable = builder.StartTable();
midtable.SetBorders(LineStyle.ThinThickSmallGap, 4.0d, System.Drawing.Color.Black);
builder.InsertCell();

builder.InsertParagraph();
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
builder.Font.Size = 10;
builder.Font.Bold = false;
builder.Write("Test\r\nTest\r\nTest\r\n");
builder.Write("ATTN: Test");
builder.InsertParagraph();
builder.InsertParagraph();
builder.Font.Bold = true;
builder.Write("Test:");
builder.Font.Bold = false;
builder.Write("Test \r\nTest");

builder.InsertCell();

builder.InsertParagraph();
builder.CellFormat.Borders.Left.LineStyle = LineStyle.Single;
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
builder.Font.Size = 10;
builder.Font.Bold = false;
builder.Write("Test\r\nTest\r\nTest 11747 USA\r\n");
builder.Write("ATTN: Test");
builder.InsertParagraph();
builder.InsertParagraph();
builder.Font.Bold = true;
builder.Write("Test:");
builder.Font.Bold = false;
builder.Write("Tets");
builder.EndRow();
builder.EndTable();

Attached is the table style I want. Please suggest.

@Sudrashya Please try using the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.StartTable();
builder.InsertCell();
builder.Write("test\r\ntest\r\ntest\r\ntest\r\ntest\r\ntest\r\ntest");

builder.InsertCell();
builder.CellFormat.Borders.Left.LineStyle = LineStyle.Single;
builder.Write("test\r\ntest\r\ntest\r\ntest\r\ntest\r\ntest\r\ntest");
builder.EndRow();
            
Table midtable = builder.EndTable();
midtable.SetBorder(BorderType.Top, LineStyle.ThinThickSmallGap, 4.0d, System.Drawing.Color.Black, true);
midtable.SetBorder(BorderType.Bottom, LineStyle.ThinThickSmallGap, 4.0d, System.Drawing.Color.Black, true);
midtable.SetBorder(BorderType.Left, LineStyle.None, 0, System.Drawing.Color.Empty, true);
midtable.SetBorder(BorderType.Right, LineStyle.None, 0, System.Drawing.Color.Empty, true);

doc.Save(@"C:\Temp\out.docx");

out.docx (7.2 KB)