Hi,
I want to add a HTML table to richtextbox. I succeeded on adding but with problems. My code adds table but it doesn't take any properties of table for example colspan="2". It simply adds the table.
My sample html table:
<html><head></head><body><table border="1" height="500px" width="500px"><tr><td colspan="3">Header</td></tr><tr><td rowspan="2">Sample</td><td colspan="2">Sample1</td></tr><tr><td>YES</td><td>NO</td></tr><tr><td>R1</td><td>Price1</td><td>Price2</td></tr><tr><td>R2</td><td>Price3</td><td>Price4</td></tr></table></body></html>
Here is my code:
WebBrowser wb = new WebBrowser(); try { FileStream fileStream = new FileStream(@"d:\Users\fstylecihat\Desktop\sample.html", FileMode.Open,FileAccess.Read); wb.DocumentStream = fileStream; Application.DoEvents(); wb.Document.ExecCommand("SelectAll", false, null); wb.Document.ExecCommand("Copy", false, null); richTextBox1.Paste(); richTextBox1.ReadOnly = true; } finally { fileStream.Close(); }
Does RichTextBox control able to show HTML tags with their properties? Any suggestions?
Thanks