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); } } }
public static void deleteColumn(IHTMLElement m_oHTMLCtxMenu) { HTMLEditHelper htmledit = new HTMLEditHelper(); IHTMLTableCell cell = m_oHTMLCtxMenu as IHTMLTableCell; if (cell == null) { return; } int index = cell.cellIndex; if (index < 0) { index = 0; } IHTMLTable table = htmledit.GetParentTable(m_oHTMLCtxMenu); if (table == null) { return; } htmledit.DeleteCol(table, index); }