public static void insertColumn(IHTMLElement m_oHTMLCtxMenu) { HTMLEditHelper htmledit = new HTMLEditHelper(); IHTMLTableCell cell = m_oHTMLCtxMenu as IHTMLTableCell; int index = 0; if (cell != null) { index = cell.cellIndex; } IHTMLTable table = htmledit.GetParentTable(m_oHTMLCtxMenu); if (table == null) { return; } htmledit.InsertCol(table, index); }
public static void changeColumns(IHTMLTable table, int setcolcount) { HTMLEditHelper htmledit = new HTMLEditHelper(); int colcount = htmledit.GetColCount(table, 0); int rowcount = htmledit.GetRowCount(table); int addcolcount = setcolcount - colcount; if (addcolcount > 0) { for (int i = 0; i < addcolcount; i++) { htmledit.InsertCol(table, 1); } } else if (addcolcount < 0) { for (int i = 0; i > addcolcount; i--) { htmledit.DeleteCol(table, 1); } } }