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 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

Re: How can I resize a cell
Posted by: Manach (222.254.184.---)
Date: Monday, 03-Dec-2007, 04:42:31

Hi ramida,

Thanks for your reply.
I tried your code but it worked the same as mine above. Cell's width always increase instead of decrease.

Thanks,
Manach.

Re: How can I resize a cell
Posted by: bedo (193.227.3.---)
Date: Wednesday, 30-Jan-2008, 09:22:15

i found solution thanks



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.
ETuUp
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.