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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:19:45+00:00 2026-05-15T22:19:45+00:00

I am trying to parse a response data as html format. The data contains

  • 0

I am trying to parse a response data as html format. The data contains multiple tables (not nested tables). I load the html with ajax and trying to loop through the data with jquery.

The problem is No result when I start with ‘table’ for looping (I have multiple tables and have no ID for the table.) When I use ‘tr’ It works well in firefox and chrome but not in IE.

I would like to know how I can loop through these tables.
Here is the code I was trying.

<html>
<head>
<title>Html table tParser</title>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script language="JavaScript">
 $(document).ready(function(){   
        $.ajax({
                url: "htmltables.html",
                cache: false,
                success: function(html)  
                { 
                 //alert( (html.length));
                 //alert( $(html).find('table').size() );  
                $(html).find('table').each(function(index) 
                { 
                    document.write('<br />'+'<br />'+ 'Table:' + index + '<br />')
                    $(this).find('tr').each(function(index) {
                        document.write('<br />'+'<br />'+ 'Row :' + index + '<br />');                     
                        $(this).find('td').each(function(index) {                                                       
                            document.write($(this).text() + '<br />');
                        });  //td
                    }); //tr    
                });  //table
         } //success
             }); // $.ajax(
  });//$(document).ready(function    

     </script>
   </head>
   <body>
   </body>
</html>

/*------------------------------ */
/* Here is the sample html file I was trying to parse*/

<html>
<head>
<title></title>
</head>

<body>
<table width="200" border="1">
  <tr>
    <td>1</td>
    <td>1</td>
    <td>1</td>
  </tr>
  <tr>
    <td>2</td>
    <td>2</td>
    <td>2</td>
  </tr>
  <tr>
    <td>3</td>
    <td>3</td>
    <td>3</td>
  </tr>
</table>
<table width="200" border="1">
  <tr>
    <td>4</td>
    <td>4</td>
    <td>5</td>
  </tr>
  <tr>
    <td>5</td>
    <td>4</td>
    <td>5</td>
  </tr>
  <tr>
    <td>6</td>
    <td>4</td>
    <td>5</td>
  </tr>
</table>

</body>
</html>
  • 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-05-15T22:19:46+00:00Added an answer on May 15, 2026 at 10:19 pm

    maybe try

    $(html).wrap('<span>').parent().find('table')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to traverse an AJAX response, which contains a remote web page (an
I'm trying to parse an NSString that contains JSON data into an NSDictionary using
I was trying to parse response data from web server. I am using Xcode
I'm trying to parse a json response data from youtube api but i keep
I'm trying to parse this XML string: <?xml version=1.0 encoding=UTF-8 standalone=no?> <response type=success> <lots>
Trying to parse an HTML document and extract some elements (any links to text
I have been trying to parse webpages by use of the HTML DOMObject in
I am trying to sending XML content through POST to a controller ('Parse') method
Hi im getting a error saying that adwhirl cannot parse json response Im trying
I'm trying to parse HTML content using HTMLParser and with the help of it

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.