<table border="1">
<th>Title</th>
<th>price</th>
<tr>
<td>book</td>
<td>$20</td>
</tr >
<tr>
<td>book2</td>
<td>$19</td>
</tr>
</table>

Recommended Answers

All 12 Replies

Please use code tags and don't put the (entire) question in the title.

Do you mean to ask how to read XML and put it in a table? If so, do you want to use PHP or Javascript for that?

no no.i want a XML code to this HTML table for education purpose only.I don't want this to do anything .So no need of scripting langs.Just the XML
Thanks

Ah. You have to use &lt; and &gt; instead of < and >.

can you write the XML to above one please?

Well, as that's downvoted, it's probably not what you want? But to answer your question, no, I'm not going to write XML for you. It's really simple and there's a lot to find about it, for example the link I posted above.

I'm not sure but do you want this table as XML structure ? XML is not like HTML, XML has not fixed predefine tags whether HTML has. You must define your own tag that related with the type of the data as much as you need.
Is that what you want, @twiss link would be appreciate for you, because you'll need to learn.

yeah,i want that in XML structure .and don't want it to do anything too.I am confused because there are a lots of ways.Looking for the best way
@twiss here you go,+1 then lol

OK. I'm not XML expert. But I can do a little bit like following.

<?xml version="1.0"?>
<book>
    <title>XML</title>
    <price>$3.0</price>
</book>
<book>
    <title>HTML</title>
    <price>$4.0</price>
</book>

As understanding your table, you've only two title, and price for each book. You can add addition element such <isbn>23232</isbn><published_date>Jun-28-2012</published_date> , ISBN number and the published date of the book as you like.
Hope that it will appreciate for you.

Yes, indeed. An XML should also, however, include a single root element, such as this:

<?xml version="1.0"?>
<library>
    <book>
        <title>XML</title>
        <price>$3.0</price>
    </book>
    <book>
        <title>HTML</title>
        <price>$4.0</price>
    </book>
</library>

@twiss, thanks man. You're right, I forgot it.

great.thanks for answeres both of you :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.