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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:50:15+00:00 2026-05-14T02:50:15+00:00

I am parsing html tabular information with the help of the html agility pack

  • 0

I am parsing html tabular information with the help of the html agility pack. Now First I am finding the rows in that table like

var rows = table.Descendants("tr");

then I find the cell data for each row like

foreach(var row in rows)
{
     string rowInnerText = row.InnerText;
}

That gives me the cell data.But with no spaces between them like NameAdressPhone No but I want the innertext like Name Address Phone No means where there is td tag I want to keep there one space between different column cell.

  • 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-14T02:50:15+00:00Added an answer on May 14, 2026 at 2:50 am

    Here is an idea, however completely untested:

    var rows = table.Descendants("tr").Select(tr =>
        string.Join(" ", tr.Descendants("td").Select(td => td.InnerText).ToArray()));
    

    This should give you en IEnumerable<string> where each contained element represents one row from the table, in the format described in your question. If you actually need your loop over the rows for other processing, keep your foreach loop and use the LINQ magic in its body:

    var rows = table.Descendants("tr");
    
    foreach (var row in rows)
    {
         string rowInnerText = string.Join(" ",
             row.Descendants("td").Select(td => td.InnerText).ToArray());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing the tabular information from the html file with the help of
I am parsing html file with the help of the html agility pack to
I am parsing the html file to extract tabular information through column names. And
I do html parsing like this Android HTML Parser Example Now I have a
Is there anything like Jsoup but instead of parsing HTML, I need to parse
I have trouble parsing a HTML table using Nokogiri and Ruby. My HTML table
I am parsing and html/xml file. I am bit confused with the fact that
I am parsing html page now any of string comes from html page I
I'm parsing HTML and I need to get only tags with selector like div.content
i have create a c# form application for parsing Html using Winista.html parser. Now

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.