Beispiel #1
0
        public static void insertRow(IHTMLElement m_oHTMLCtxMenu)
        {
            HTMLEditHelper htmledit = new HTMLEditHelper();
            IHTMLTableCell cell     = m_oHTMLCtxMenu as IHTMLTableCell;
            IHTMLTableRow  row      = htmledit.GetParentRow(m_oHTMLCtxMenu);
            int            index    = 0;

            if (row != null)
            {
                index = row.rowIndex;
            }
            IHTMLTable table = htmledit.GetParentTable(m_oHTMLCtxMenu);

            if (table == null)
            {
                return;
            }
            htmledit.InsertRow(table, index, htmledit.Row_GetCellCount(row));
        }
Beispiel #2
0
        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);
                }
            }
        }