Thursday, September 12, 2013

How To Convert HTML Table In To Div Tag

Using Jquery Convert HTML Table in to Div tag:

Jquery function converting table in to div, see below jquery function:
<script type="text/javascript">
        $('table').replaceWith(function () {
            var html = ''; 
            $('tr'this).each(function () {
                html += '<div>';
                $('td'this).each(function () {
                    html += '<div>' + $(this).html() + '</div>';
                html += '</div>';
            return '<div>' + html + '</div>';
Table :
            <td width="180" valign="top" id="maintable-toc">
                <div id="toc">
                        <a id="toc-title" href="index.htm">Table of Contents</a></h2>
                    <ol class="section">
                            <div class="currentpage">
                                <li><a href="page_02.htm">Pages </a></li>
                                <li><a href="page_03.htm">Sections </a></li>
                                <li><a href="page_04.htm">Headings </a></li>
                        <li><a href="page_07.htm">Images </a></li>
            <td width="*" valign="top" id="maintable-content">
                <div id="main-content-withtoc">
                    <a name="Main"></a>
                    <p>This section looks at the basics of work.</p>

Friday, September 6, 2013

How to create sql query result to xml file

Create Sql Query Result To XML Format

Sql Query: Getting all users data from sql server in xml file format...

See below Query:

FROM dbo.Users
FOR XML PATH('User'), ROOT ('Users')

Results: (XML Format):