Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:55:02+00:00 2026-06-14T02:55:02+00:00

I am doing a CLR procedure of sending mail, I have composed the html

  • 0

I am doing a CLR procedure of sending mail, I have composed the html into my string , After binding some dynamic values I have been able to send mail.

But Now the issue is , I am getting a string which containing the HTML, So I want to find the first <table> and then change its width. it.[Due to large width the template is disturbing]. This is the body of the email.

 string StrHtml =" <table cellspacing='1' cellpadding='10' border='0'
style='width:880px'></table>"

I want to change the style='width:880px' to style='width:550px'

I am doing this code only in class library. what is the best way to do this?

My Code is :

string ImgPath = string.Empty;
ImgPath = Convert.ToString(ds.Tables[0].Rows[i]["GroupMessage"]);
string pattern = string.Empty;
pattern = System.Text.RegularExpressions.Regex.(ImgPath, "(<table.*?>.*</table>", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Groups[1].Value;  

MailMessage message = new MailMessage();
message.AlternateViews.Add(htmlMail);
message.Body = ImgPath ; //
message.IsBodyHtml = true;
//Other mail sending code here.....
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:55:04+00:00Added an answer on June 14, 2026 at 2:55 am

    I am getting the html string in below format and I want to get only the attribute value of
    style=”width: 880px” , which is always changing.[This is only work if the width is mention in style tag. And that is the my case.]

    ImgPath ==>

     <table border="0" cellpadding="10" cellspacing="1" style="width: 880px">
        // some other code goes here
        </html>
    

    Answer ==> I used regular expression in my class, [want to make DLL file from that class]

    string StrStyTag = string.Empty;
    StrStyTag = System.Text.RegularExpressions.Regex.Match(ImgPath, "<table.+?style=(.+?)>", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Groups[1].Value;
    

    I am getting the value as ==> “width: 880px”, So after doing some string manipulations I make the 880px to fix 550px.

    Thanks for all those who help me to resolved it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an in memory DataTable in a CLR procedure. After significant processing the
I have a very simple CLR Function for doing Regex Matching public static SqlBoolean
Doing some jquery animation. I have certain divs set up with an attribute of
I have a CLR stored procedure that references an assembly created in VS 2008
I am doing some experiments with IronPython 2.6.1 and the clr.CompileModules function to compile
I have written the following piece of code ( sql clr stored procedure )
I'm doing an intro presentation on the .Net CLR GC and have all the
On a quest to migrate some new UI into Managed/C# land, I have recently
Doing my first SL4 MVVM RIA based application and i ran into the following
Doing some homework here (second assignment, still extremely green...). The object is to read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.