TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ravi chaudhary
NA
14
7.3k
Underline single cell in Html table
Dec 24 2014 5:50 AM
How to write code for underline single cell in mshtml table...
I have made code for underline all cell but could not do for single cell on which user wants...
Code is attached below...
private void Underline single cell()
{
try
{
mshtmlElement tableElement = GetHTMLElementOfTable();
tableElement.setAttribute("id", "DataTable");
HtmlElement table = this.editorWebBrowser.Document.GetElementById("DataTable");
if (table != null)
{
//you can get rows like that
int i = 1;
foreach (HtmlElement row in table.GetElementsByTagName("tr"))
{
foreach (HtmlElement cell in row.GetElementsByTagName("td"))
{
////cell.InnerText = i.ToString();
cell.Style = "BORDER-BOTTOM: thick solid #0000FF;";
i++;
}
}
}
else
{
throw new HtmlEditorException("Please Select a table table", "ActionTableConvert");
}
}
catch (Exception ex)
{
// process the standard exception
OnHtmlException(new HtmlExceptionEventArgs(null, ex));
}
}
Reply
Answers (
2
)
Crystal Report in c#
Smart Search within Elastic Search like Google