How to remove a column

Hi. I want to find text: “3” and remove the column where I found this text. How to do that? Thanks
table


It must work with this file also. For example I need to remove column with text “5”

Hi John,

Try this:

var document = DocumentModel.Load("input.docx");

var content = document.Content.Find("5").First();
var cell = (TableCell)content.Start.Parent.GetParentElements(ElementType.TableCell).First();
int index = cell.Parent.Cells.IndexOf(cell);

foreach (var row in cell.Parent.Parent.Rows)
    row.Cells.RemoveAt(index);

document.Save("output.docx");

I hope it helps.

Regards,
Mario