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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:58:41+00:00 2026-05-31T12:58:41+00:00

I have a mobile app and I have the following problem. I select some

  • 0

I have a mobile app and I have the following problem.

I select some values from two tables and I am trying to create one table from these selections.
Here is my code:

    list.append('<table class="tablesorter">');
    list.append('<thead><tr><th>Building</th><th>Reason</th><th>Receipt</th><th>Amount</th></tr></thead><tbody>');

    for (j = 0; j < lenpay; j += 1) {
        dummy1(j);
    }

    for (i = 0; i < len; i += 1) {
        dummy(i);
    }

    list.append('</tbody></table>');

dummy and dummy1 are functions that selects data from table and build the rows for the html table

function dummy(i){
    selectsql......

    list.append('<tr><td>' + data A + '</td><td>' + data B + '</td><td>' + data C + '</td><td><font color="blue">' + data D + '</font></td></tr>');
}

and

function dummy(i){
    selectsql......

    list.append('<tr><td>' + DATA A + '</td><td>' + DATA B + '</td><td>' + DATA C + '</td><td><font color="blue">' + DATA D + '</font></td></tr>');
}

the result is a table look html but if inspect it with firebug the table is broken. So I cannot sort it by a column. What I am doing wrong?

How can I create a right html table?

  • 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-31T12:58:42+00:00Added an answer on May 31, 2026 at 12:58 pm

    Your table is broken because you’re using it wrong. When you do this:

    list.append('<table class="tablesorter">');
    

    You’re already appending a <table></table> including the closing tag even if not specified. Then you do this which appends another closing tag…

    list.append('</tbody></table>');
    

    Use append() with full objects and not markup parts. And, if possible, append everything at last. A good approach is to use a string variable where you put all your markup and then just ONE append() call. Also don’t use <font>, it’s been deprecated for ever. I’ve no way to try this but you get the idea:

    var html = '',
        items = [];
    
    
    function dummy(i) {
        selectsql......
    
        items.push('<tr><td>' + data A + '</td>'+
                    '<td>' + data B + '</td>'+
                    '<td>' + data C + '</td>'+
                    '<td><span class="blue">' + data D + '</span></td></tr>');
    }
    
    html += '<table class="tablesorter">' +
            '<thead>'+
            '<tr>'+
            '<th>Building</th>'+
            '<th>Reason</th>'+
            '<th>Receipt</th>'+
            '<th>Amount</th>'+
            '</tr>'+
            '</thead>'+
            '<tbody>'+
            items.join('') +
            '</tbody></table>';
    
    list.append(html);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi i am in mobile app and i have the following problem. i want
I have a windows mobile app (mymobiler) that i am trying to install and
I have a mobile platform that I am trying to write some communications code
i have a design issue regarding sending user data from a mobile phone app
I am trying to create a website that will have the following Web Access
I have a website/web app built with jquery mobile that I am trying to
I have a mobile app that is using LinqToDatasets to update/insert into a SQL
I have a mobile app webservice client that connects to a WCF webservice(on my
I have a Window Mobile app where the forms use keypreview and post the
I have been working on a Windows Mobile app for a little while 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.