C#: Online Guide
How To: Word SDK
Table Cell Processing
Table Cell Processing
  |  
Home ›› XDoc.Word ›› C# Word: Process Table Cell

C# Word - Table Cell Processing in C#.NET


Online Tutorial for Users to Set and Modify Table Cells in Word Document




Overview



C#.NET Word document table cell processing Interface control (XDoc.Word). pdf compression library c#, c# export excel sheet to pdf, vb.net print pdf to specific printer, itextsharp read pdf line by line c#, add header and footer in pdf using itextsharp c#, pdf417 reader c#. It allows users to process table cells on an existing Word file.


Related .net document control helps:
asp.net annotate pdf control: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
powerpoint viewer asp.net mvc: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net pdf viewer control: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
document viewer asp.net c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net edit pdf image control: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net pdf document viewer: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects




C# DLLs: Word Table Cell Processing



Add references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.Word.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.Word;




Create and Add Cells in Table



The following demo code will show how to create a table cell and add to table. c# itextsharp add text to existing pdf, how to search text in pdf using c#, vb.net pdf password opener, itextsharp remove text from pdf c#, how to add image in pdf using c#, open pdf and draw c#, c# pdf add background.



String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main document
IDocument doc = document.GetDocument();
//Create a table in body
ITable table = doc.CreateTable(3, 3);
//Create a table row for table
ITable row = table.CreateRow(3);
//Creta a table cell for table row
ITableCell cell = row.CreateCell();
//Save the document
doc.Save(@"");





Properties Setup in Table Cell



In C#.NET applications, users can set and modify property of each cell in table by using following sample code. how to view pdf file in asp.net using c#, asp net show word document in browser, asp.net itextsharp add image to pdf, preview pdf in asp.net mvc, how to edit pdf file using itextsharp in asp.net, asp.net mvc pdf viewer free, asp net remove text from pdf javascript.




String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main document
IDocument doc = document.GetDocument();
//Create a Table for document
ITable table = doc.CreateTable(3, 3);
//Get all rows in table
List<ITableRow> rows = table.GetRows();
//Get first row
ITableRow row = rows[0];
//Get all cells in first row
List<ITableCell> cells = row.GetCells();
//Get first cell
ITableCell cell = cells[0];
//Set properties for cell
//Cell width fit text
cell.SetFitText(true);
//Text flow direction
cell.SetTextFlowDirection(TextDirection.LrTbV);
//Shadow fill Color
cell.SetShadowFillColor(false, Color.Red);
//Cell width
cell.SetCellWidth(200);
//MORE TODO:
//
//
doc.Save(@"");





Create, Add and Modify Paragraph in Table Cell



Sometimes you may need to create some text content or nest table in Word document, the following demo code will show you how to create a text paragraph in table cell.




String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main document
IDocument doc = document.GetDocument();
//Create a Table for document
ITable table = doc.CreateTable(3, 3);
//Get all rows in table
List<ITableRow> rows = table.GetRows();
//Get first row
ITableRow row = rows[0];
//Get all cells in first row
List<ITableCell> cells = row.GetCells();
//Get first cell
ITableCell cell = cells[0];
//Create text content for cell
IParagraph paragraph = cell.CreateParagraph();
IRun run = paragraph.CreateARun();
run.CreateText("This is the first cell in table");
doc.Save(@"");




Create, Add and Modify Nest Table in Table Cell



The following demo code shows how to create nest tables in a cell.




String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main document
IDocument doc = document.GetDocument();
//Create a Table for document
ITable table = doc.CreateTable(3, 3);
//Get all rows in table
List<ITableRow> rows = table.GetRows();
//Get first row
ITableRow row = rows[0];
//Get all cells in first row
List<ITableCell> cells = row.GetCells();
//Get first cell
ITableCell cell = cells[0];
//Create a nest table with 2 columns and 2 rows for cell
ITable nestTable = cell.CreateTable(2, 2);

doc.Save(@"");