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.
How can I resize a cell
Posted by:
Manach (203.162.3.---)
Date: Tuesday, 27-Nov-2007, 06:44:08
Hi all,
The control is great. Now I want to resize a cell in a table. How can i do that.
Here is my code:
// increase cell's width (works right)
IHTMLTableCell cell = (mshtml.IHTMLTableCell)htmlEditor1.CurrentElement;
IHTMLElement cellElement = (IHTMLElement) cell;
cellElement.setAttribute("width", cellElement.offsetWidth + 1, 0);
// decrease cell's width (works wrong - just replace plus with minus sign)
IHTMLTableCell cell = (mshtml.IHTMLTableCell)htmlEditor1.CurrentElement;
IHTMLElement cellElement = (IHTMLElement) cell;
cellElement.setAttribute("width", cellElement.offsetWidth - 1, 0);
what's going on with my code above????
Anyone can help?
Many thank.
Manach
Re: How can I resize a cell
Posted by: ramida (---.nc.res.rr.com)
Date: Monday, 03-Dec-2007, 04:09:45
Manach,
Try this:
// decrease cell's width
IHTMLTableCell cell = (mshtml.IHTMLTableCell)htmlEditor1.CurrentElement;
IHTMLElement cellElement = (IHTMLElement) cell;
int x = cellElement.offsetWidth;
cellElement.removeAttribute("width", 0);
cellElement.setAttribute("width", x - 1, 0);
HTH, Audimar