HtmlEditor :  Phorum 5 The fastest message board... ever.

This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.

Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
How to add a new row in a selected table...
Posted by: bricke (---.15-87-r.retail.telecomitalia.it)
Date: Friday, 02-Feb-2007, 17:21:51

Hi, if I create a new table, the table cames with a particular number of columns and row, is there a system to add the number of row of a particular table (the table where the cursor is on) ??

Could you give me some example?
I'm new to C#...

Re: How to add a new row in a selected table...
Posted by: bricke (217.221.181.---)
Date: Monday, 05-Feb-2007, 11:27:05

Solved...

Re: How to add a new row in a selected table...
Posted by: Clyde Davies (193.132.159.---)
Date: Tuesday, 06-Feb-2007, 09:26:18

Are you going to post it then, or leave us all wondering? ;-)



--------------------------------------------------------------------------------------------
deadlyvices@hotmail.com
Currently writing the GuideDog editor using MSHTML in my copious free time...

Re: How to add a new row in a selected table...
Posted by: bricke (217.221.181.---)
Date: Tuesday, 06-Feb-2007, 09:29:38

mshtml.IHTMLTable t ;
mshtml.IHTMLElement currentElement = (mshtml.IHTMLElement)this.htmlEditor1.CurrentElement;
if(currentElement.GetType().Name == "HTMLTableCellClass")
{
mshtml.HTMLTableCellClass td = (mshtml.HTMLTableCellClass)currentElement;
t = (mshtml.IHTMLTable)td.offsetParent;
mshtml.HTMLTableRowClass row = (mshtml.HTMLTableRowClass)td.parentElement;
TableInsertRow(row.sectionRowIndex+2,t);
//insert a new row under the cursor
}


//this is the table insert row method

private void TableInsertRow(int index, mshtml.IHTMLTable table)
{
mshtml.HTMLTableRowClass row = (mshtml.HTMLTableRowClass)table.insertRow(index-1);
row.m
for(int i=0; i<table.cols; i++)
{
mshtml.IHTMLElement c = (mshtml.IHTMLElement)row.insertCell(-1);
c.innerHTML = " ";
}
}

//index-1 is for start conting from 1 and not from 0



Post Edited (02-06-07 09:30)

Re: How to add a new row in a selected table...
Posted by: horsedrowner (---.adsl.xs4all.nl)
Date: Friday, 17-Aug-2007, 09:21:59

what do you mean with 'row.m' ?

Re: How to add a new row in a selected table...
Posted by: horsedrowner (---.adsl.xs4all.nl)
Date: Friday, 17-Aug-2007, 09:29:22

Sry for double post but the code doesnt work (for me)



Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
UuPHj
This is a moderated forum. Your message will remain hidden until it has been approved by a moderator or administrator
This forum powered by Phorum.