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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:47:13+00:00 2026-06-05T19:47:13+00:00

I should add rows to the table with jQuery: <table class=table> <tbody id=dh-values> </tbody>

  • 0

I should add rows to the table with jQuery:

    <table class="table">
      <tbody id="dh-values">
      </tbody>
    </table>

I’ve written the following code:

  function displayHash(fieldName) {
    $('#dh-values').append('<tr></tr>').append('<td id="dh-'+fieldName+'">'+$('#'+fieldName).val()+'</td>').append('<td id="dh-'+fieldName+'-h">'+hex_sha1($('#'+fieldName).val())+'</td>');
  };

But it looks awful. Is there any way to simplify that?

  • 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-06-05T19:47:15+00:00Added an answer on June 5, 2026 at 7:47 pm

    Combined answer of Esalija, amnotiam et al

    DEMO

    function displayHash(fieldID) {
        var val = $('#'+fieldID).val();
        var valSha = hex_sha1(val);
        $("<tr>").appendTo("#dh-values")
           .append('<td id="dh-'+fieldID+'">'+val+'</td>')
           .append('<td id="dh-'+fieldID+'-h">'+valSha+'</td>');
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that should add an active css class to the
I have following code: os.chdir(os.path.dirname(os.path.realpath(__file__)) + /../test) path.append(os.getcwd()) os.chdir(os.path.dirname(os.path.realpath(__file__))) Which should add /../test to
What code I should add to accept null from WHERE statement. { int numApprovals
I need to design a function to return negative numbers unchanged but should add
http://www.w3.org/QA/Tools/Icons If my code is valid then Should i add logo to all my
Should be a relatively simple question -- I'm trying to add a css class
Here in the below fiddle, i am trying to add and remove table rows
I have a table which has a button to Add Rows. This button adds
I'm trying to add rows dynamically to a System.Web.UI.WebControls.Table control in ASP.NET. I found
I have a table where I add, remove and resort rows from time to

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.