Aisha Srivastava

Aisha Srivastava

  • NA
  • 230
  • 28.7k

Remove cell border..

Feb 1 2015 2:36 AM
I am useing htmltable in webbrowser control (win form) *
I am not able to remove the border of selected cell .I used the below code and able to remove left border and top border of cell but could not remove right and bottom border.....please suggest any one..
Code snippet is added below...
Thanks in advance...





        public void stylecell()
        {
            mshtmlTable table1 = null;
            mshtmlTableRow row1 = null;
            mshtmlTableCell cell1 = null;
            GetTableElement(out table1, out row1, out cell1);

            HtmlElement table = getTableHTMLElement();
            try
            {
                if (table != null)
                {
                    //table.Style = "border-collapse: collapse";
                    HtmlElement selectedCell = table.GetElementsByTagName("tr")[row1.rowIndex].GetElementsByTagName("td")[cell1.cellIndex];

                    {

                        //selectedCell.Style = "border-right:solid ;border-top:solid;border-left:solid;"; //border-bottom: none";

                        selectedCell.Style = "border:None";
                    }
                }

                else
                {
                    throw new HtmlEditorException("Cell not selected", "underlineComand");
                }
            }
            catch (Exception ex)
            {
                // process the standard exception
                OnHtmlException(new HtmlExceptionEventArgs(null, ex));
            }
        }

Answers (3)