Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a html page there is lots of tag. i want to just use some particular tag data . For Example page have 5 html table(table with in table) tag and want to just use 3 table tag data.
how can i do this
Posted

Where and how do you want to use it?

Elements can be identified using their ID.

For example, if one of your table has an id table1,
in JavaScript, you can access the table element using
JavaScript
var tableVariable1 = document.getElementById("table1");

You can access the same in C# code behind, if you have runat server tag to it. Just use it's id and press dot you will get various properties, methods and events available to it.

If this doesn't help, please add more details to your question.
 
Share this answer
 
Comments
Member 7958281 26-Jul-11 7:25am    
Hi Thanks ,
But My Question is that,i have a Html tag string and i want to show just some table from that html tag string and remove other html tag code from string.
Ankur\m/ 26-Jul-11 8:16am    
If the HTML is well formed i.e if it follows the XHTML rules, you can use various classes present in the System.XML namespaces to parse the document. An example is given below.
If it doesn't, you will either need to write an HTML parser or use an existing one to parse and navigate to the parts of the document.
You can use DOM for reading HTML file
XmlDocument comHTML = new XmlDocument();
comHTML.Load("FilePath");
//Search for Specific tag
XmlNodeList xNodeList = xdHtml.GetElementByTagName("TagName");
if (xNodeList.Count == 0)
   //Tag Not Exist
else
   //Tag Exist
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900