Skip to content

Commit edd8d15

Browse files
addressed the feedbacks
1 parent 3dd2ddc commit edd8d15

File tree

1 file changed

+1
-9
lines changed
  • Tables/Reduce-Height-of-Empty-Cells/.NET/Reduce-Height-of-Empty-Cells

1 file changed

+1
-9
lines changed

Tables/Reduce-Height-of-Empty-Cells/.NET/Reduce-Height-of-Empty-Cells/Program.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
//Creates a new Word document.
2-
using Syncfusion.DocIO;
1+
using Syncfusion.DocIO;
32
using Syncfusion.DocIO.DLS;
43

5-
//Register Syncfusion license
6-
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("Mgo+DSMBMAY9C3t2UlhhQlNHfV5DQmBWfFN0QXNYfVRwdF9GYEwgOX1dQl9nSXZTc0VlWndfcXNSQWc=");
7-
84
// Open the existing Word document ("Template.docx") for reading and writing.
95
using (FileStream inputFileStream = new FileStream(Path.GetFullPath("Data/Template.docx"), FileMode.Open, FileAccess.ReadWrite))
106
{
@@ -13,24 +9,20 @@
139
{
1410
// Retrieve the last section of the document.
1511
IWSection section = document.LastSection;
16-
1712
// Retrieve the first table from the section.
1813
IWTable table = section.Body.Tables[0];
19-
2014
// Iterate through each row in the table.
2115
foreach (WTableRow row in table.Rows)
2216
{
2317
// Set the row height type to "AtLeast" and height to 0 to minimize height.
2418
row.HeightType = TableRowHeightType.AtLeast;
2519
row.Height = 0;
26-
2720
// Iterate through each cell in the row.
2821
foreach (WTableCell cell in row.Cells)
2922
{
3023
// Remove top and bottom margins of the cell.
3124
cell.CellFormat.Paddings.Top = 0;
3225
cell.CellFormat.Paddings.Bottom = 0;
33-
3426
// Iterate through paragraphs in each cell.
3527
foreach (IWParagraph paragraph in cell.Paragraphs)
3628
{

0 commit comments

Comments
 (0)