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 8658393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:45:22+00:00 2026-06-12T15:45:22+00:00

I have the following HTML table and want to replace the subtable class =

  • 0

I have the following HTML table and want to replace the subtable “class = stock_splitdata” with a text.I am stuck at how to collect the td values of the “stock_splitdata” table and change them to text .

<table>
    <thead>
    <tr>
        <th class="header" align="left" width="200px">STOCK</th>
        <th class="header" align="right" width="90px">CATEGORY</th>
        <th class="header" align="right" width="75px">SALES QTY</th>
        <th class="header" align="right" width="75px">GWP QTY</th>
        <th class="header" align="right" width="120px">SALES DATE</th>
        <th class="header" align="right" width="100px">RECEIPT NO</th>
        <th class="{sorter: 'fancyNumber'} header" align="right" width="120px">GROSS SALES</th>

    </tr>
    </thead>
    <tbody>
    <tr>
              <td align="left" width="200px">
                <table class="stock_splitdata" cellpadding="0" cellspacing="0">
                <tbody><tr>
                    <td width="80px">BM1339</td>
                    <td width="40px">DR2</td>
                    <td width="15px">D</td>
                    <td width="30px">80</td>
                </tr>
                </tbody></table>
              </td>
              <td align="right" width="105px">BRA</td>
              <td align="right" width="85px">1</td>
              <td align="right" width="75px">0</td>
              <td align="right" width="120px">01/10/2012</td>
              <td align="right" width="120px">40756</td>
              <td align="right" width="120px">109.90</td>

              </tr><tr>
              <td align="left" width="200px">
                <table class="stock_splitdata" cellpadding="0" cellspacing="0">
                <tbody><tr>
                    <td width="80px">BM1431</td>
                    <td width="40px">BN</td>
                    <td width="15px">D</td>
                    <td width="30px">80</td>
                </tr>
                </tbody></table>
              </td>
              <td align="right" width="105px">BRA</td>
              <td align="right" width="85px">1</td>
              <td align="right" width="75px">0</td>
              <td align="right" width="120px">01/10/2012</td>
              <td align="right" width="120px">40756</td>
              <td align="right" width="120px">69.00</td>
              </tr>
      </tbody>
      <table>

So that the final values will be as below:

<table>
<thead>
<tr>
    <th class="header" align="left" width="200px">STOCK</th>
    <th class="header" align="right" width="90px">CATEGORY</th>
    <th class="header" align="right" width="75px">SALES QTY</th>
    <th class="header" align="right" width="75px">GWP QTY</th>
    <th class="header" align="right" width="120px">SALES DATE</th>
    <th class="header" align="right" width="100px">RECEIPT NO</th>
    <th class="{sorter: 'fancyNumber'} header" align="right" width="120px">GROSS SALES</th>

</tr>
</thead>
<tbody>
<tr>
          <td align="left" width="200px">
          BM1339 DR2 D 80
          </td>
          <td align="right" width="105px">BRA</td>
          <td align="right" width="85px">1</td>
          <td align="right" width="75px">0</td>
          <td align="right" width="120px">01/10/2012</td>
          <td align="right" width="120px">40756</td>
          <td align="right" width="120px">109.90</td>

          </tr><tr>
          <td align="left" width="200px">
          BM1431 BN D 80
          </td>
          <td align="right" width="105px">BRA</td>
          <td align="right" width="85px">1</td>
          <td align="right" width="75px">0</td>
          <td align="right" width="120px">01/10/2012</td>
          <td align="right" width="120px">40756</td>
          <td align="right" width="120px">69.00</td>
          </tr>
  </tbody>
  <table>
  • 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-12T15:45:24+00:00Added an answer on June 12, 2026 at 3:45 pm

    You would need to convert the .stock_splitdata td text to an array, then join it together with a space delimiter, and then replace the .stock_splitdata table.

    Something like this:

    $(".stock_splitdata").each(function() {
        var $table = $(this);
        var values = $("td", $table).map(function() {
            return $(this).text();
        }).get();
        $table.replaceWith(values.join(" "));
    });
    

    Example fiddle

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

Sidebar

Related Questions

I have the following HTML: <table> <tr class=row> <td class=field> <input type=text /> </td>
I have the following html table <table id={64ED3A94-5833-4CC7-869F-CCE583B498BE} class=ms-listviewtable width=100% cellspacing=0 cellpadding=1 border=0 xmlns:o=urn:schemas-microsoft-com:office:office
I have the following HTML table: <table style=width: 100%;> <tr> <td class=title_bar_left_border></td> <td class=title_bar_middle></td>
I have the following html structure (which is generated and I can't change): <table
I have the following html code: <form> <table> <tbody> <tr> <td> <span>Quantity<span class=pull-right>3</span> <input
I have the following HTML. <body> <div class=header></div> <div class=navdiv></div> <div class=mainarea> <p></p> <table>
I have the following HTML (a snippet): <td class=ms-vb-title height=100%> <table class=ms-unselectedtitle onmouseover=OnItem(this) ctxname=ctx1
I have following html: <table width=100%;> <tr><hr style=width:100%;></hr></tr> <tr> <span style=float:left>abc</span> <span class=noindex style=float:right>PageID</span>
I have the following html page: <body> <div class=hide1 style=width:1000px; height:1000px;> <table width=100% border=0
I have the following HTML: <table> <tr> <td><button class=foo type=button>Click Me</button></td> </tr> <tr> <td><button

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.