public static void changeRows(IHTMLTable table, int setrowcount) { HTMLEditHelper htmledit = new HTMLEditHelper(); int rowcount = htmledit.GetRowCount(table); int colcount = htmledit.GetColCount(table, 0); int addrowcount = setrowcount - rowcount; if (addrowcount > 0) { for (int i = 0; i < addrowcount; i++) { htmledit.InsertRow(table, rowcount++ - 1, colcount); } } else if (addrowcount < 0) { for (int i = 0; i > addrowcount; i--) { htmledit.DeleteRow(table, rowcount-- - 1); } } }
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); } } }