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

  • Home
  • SEARCH
  • 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 9150065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:33:46+00:00 2026-06-17T11:33:46+00:00

I am having an issue with HTML when opening a current HTML file and

  • 0

I am having an issue with HTML when opening a current HTML file and replacing what I need to using a StringBuilder… Below is the bit of code I am using to do this…

  'Lets replace the grid information!'
    Dim sb As New StringBuilder()

    sb.AppendLine(" <table>")
    sb.AppendLine("<tr>")
    '  sb.AppendLine("<th>")
    For Each column As DataGridViewColumn In DataGridView1.Columns
        sb.AppendLine("   <th>" + column.HeaderText + "</th>")
    Next
    ' sb.AppendLine("</th>")
    sb.AppendLine(" </tr>")
    sb.AppendLine("</table")

    HTML.Replace("%TABLE%", sb.ToString)

Everything is working so far, only issue I am having is getting rid of the “<” by the customers name field… I know it is because of the replace; it is adding an extra one there. But if I take it out of the append line, my grid goes out of wack… Here is a screen shot of this…

ERROR IM HAVING

Here is the source of the HTML file I am grabbing and then replacing what I need too…

<!doctype html>
<html>
<head>
    <title>Invoice %Invoice%</title>
    <link rel="stylesheet" href=%STYLE%>

    <style type="text/css">
    @import url("style.css");
    </style>
</head>
<body>
    <header>
        <h1>Invoice %Invoice%</h1>
        <address>
            <p>%Business%</p>

        </address>
        <img src="file:///%Image%" alt="" align="right">
    </header>
    <article>
        <h1>&nbsp;</h1>
        <h1>&nbsp;</h1>
        <h1>&nbsp;</h1>
        <h1>Recipient</h1>
        <address>
        <p>%Company%</p>
            <p>%Contact%</p>
            <p>%Address%</p>
        </address>
        <table class="meta">
            <tr>
                <th><span>Invoice #</span></th>
                <td><span>%Invoice%</span></td>
            </tr>
            <tr>
                <th><span>Date</span></th>
                <td><span>%Date%</span></td>
            </tr>
            <tr>
                <th><span>Amount Paid</span></th>
                <td><span id="prefix">$</span><span>0.00</span></td>
            </tr>
            <tr>
                <th><span>Amount Due</span></th>
                <td><span id="prefix">$</span><span>600.00</span></td>
            </tr>
        </table>
        <%TABLE%>   THIS IS WHERE I SEND THE TABLE TO!
        </article>
    <aside>
        <h1>&nbsp;</h1>
        <h1>&nbsp;</h1>
        <h1><span>Additional Notes</span></h1>
        <div contenteditable>
          <p align ='center'>A finance charge of 1.5% will be made on unpaid balances after 30 days.</p>
        </div>
    </aside>
</body>
</html>

Thanks!

  • 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-17T11:33:47+00:00Added an answer on June 17, 2026 at 11:33 am

    Assuming HTML is a string the replace function returns a string result, so you need:

    HTML = HTML.Replace("%TABLE%", sb.ToString)
    

    And as per the answer from
    pickypg
    you probably really need:

    HTML = HTML.Replace("<%TABLE%>", sb.ToString)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an issue with the jquery tools scrollable plugin: http://jquerytools.org/documentation/scrollable/index.html Also using
I'm having an issue creating a link like <a href=javascript:window.open('www.microsoft.com');>Visit Microsoft</a> using stringbuilder. I
I am having an issue with this site - http://thestamp.umd.edu/canvastest/test.html I'm trying to build
I'm having an issue with the HTML below: <html> <body> <p style=font-size: large> Some
I'm currently having an issue while uploading a file from Html to my rest
Having an issue here. This should be working... I have 4 elements in html
Having an issue with the code below. I performed a search on the site
I am having issues with the below HTML when resizing the window; 1: Right
What is the benefit to using Html.BeginForm? We're having some issues related to html
Hi guys I am having issue I have this query: SELECT * FROM useraccount

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.