4,375 questions
Install Spire.Doc in your Visual Studio via NuGet, and you'll be able to access a specific row and a specific cell using the following code.
using Spire.Doc;
namespace AccessToTable
{
class Program
{
static void Main(string[] args)
{
//Create a Document object
Document doc = new Document();
//Load the Word document that contains tables
doc.LoadFromFile(@"C:\Users\Administrator\Desktop\table.docx");
//Get the first section
Section section = doc.Sections[0];
//Get the first table from the section
Table table = section.Tables[0] as Table;
//Get the first row by its index
TableRow row = table.Rows[0];
//Get the first cell by its index
TableCell cell = row.Cells[0];
}
}
}