TableCellSpacing Property |
Namespace: Aspose.Words.Tables
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Table table = builder.StartTable(); builder.InsertCell(); builder.Write("Name"); builder.InsertCell(); builder.Write("مرحبًا"); builder.EndRow(); builder.InsertCell(); builder.InsertCell(); builder.EndTable(); TableStyle tableStyle = (TableStyle)doc.Styles.Add(StyleType.Table, "MyTableStyle1"); tableStyle.AllowBreakAcrossPages = true; tableStyle.Bidi = true; tableStyle.CellSpacing = 5.0; tableStyle.BottomPadding = 20.0; tableStyle.LeftPadding = 5; tableStyle.RightPadding = 10; tableStyle.TopPadding = 20.0; tableStyle.Shading.BackgroundPatternColor = Color.AntiqueWhite; tableStyle.Borders.Color = Color.Black; tableStyle.Borders.LineStyle = LineStyle.DotDash; table.Style = tableStyle; // Some Table attributes are linked to style variables Assert.AreEqual(true, table.Bidi); Assert.AreEqual(5.0, table.CellSpacing); Assert.AreEqual("MyTableStyle1", table.StyleName); doc.Save(ArtifactsDir + "Table.TableStyleCreation.docx");