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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:05:30+00:00 2026-06-14T12:05:30+00:00

I am a new to javascript. I have a problem in HTML table. (This

  • 0

I am a new to javascript. I have a problem in HTML table. (This is only a reference because the whole table will have a range of 100,000 to 2,000,000.)

This is a list and it is kinda large and to create this manually will take very long plus if I input a single “range” wrong I’ll have to edit and re-arrange then check if the “range” is correct again. I am hoping that this can be done in javascript. Anyone can help me to make the “range” to a variable like “r-1 and r-2” and a function can fill the variable increments to 5,000 or 10,000 automatically starting from 100,000 up to 2,000,000.

HTML Table

jsFiddle

<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
          <td class="range" width="15%">100,000 - 105,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">125,000 - 130,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">150,000 - 155,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">175,000 - 180,000</td><td class="value" width="10%">VALUE</td>
     </tr>

     <tr>
          <td class="range" width="15%">105,000 - 110,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">130,000 - 135,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">155,000 - 160,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">180,000 - 185,000</td><td class="value" width="10%">VALUE</td>
     </tr>

     <tr>
          <td class="range" width="15%">110,000 - 115,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">135,000 - 140,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">160,000 - 165,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">185,000 - 190,000</td><td class="value" width="10%">VALUE</td>
     </tr>

     <tr>
          <td class="range" width="15%">115,000 - 120,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">140,000 - 145,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">165,000 - 170,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">190,000 - 195,000</td><td class="value" width="10%">VALUE</td>
     </tr>

     <tr>
          <td class="range" width="15%">120,000 - 125,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">145,000 - 150,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">170,000 - 175,000</td><td class="value" width="10%">VALUE</td>

          <td class="range" width="15%">195,000 - 200,000</td><td class="value" width="10%">VALUE</td>
     </tr>
</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-06-14T12:05:31+00:00Added an answer on June 14, 2026 at 12:05 pm

    This will build the table structure shown

     $(function(){ 
         /* start & end divided by 1000*/
        var start=100, end=2000, increment=25, rowCellCount=4;;
        var html=[];
        for(i=start; i<= end- (increment*rowCellCount)+increment ; i=i+5){
            html.push('<tr>');
            for( j=0; j< rowCellCount; j++){
                var valueStart= (i+j*increment), valueEnd=valueStart+5;
    
                var text= parseThousands(valueStart)+',000 ';
                text+= valueEnd <= end ? ' - ' + parseThousands(valueEnd)+',000' :'';        
    
                html.push( '<td class="range" width="15%">'+text+'</td><td class="value" width="10%">VALUE</td>');
             }
             html.push('</tr>');
        }
    
        $('table').html( html.join(''))
    
     });
    
        function parseThousands( val){
            var txt =val.toString();
            if( txt.length==4){       
                 txt= txt.slice(0,1) +','+ txt.slice(1)       
            }
            return txt;
        }
    

    DEMO: http://jsfiddle.net/Nck5B/20/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm testing a new TeeChart HTML5/javascript and I have a problem with zoom. When
I'm kinda new to javascript running on Apache but I have the following problem.
I am new to Javascript coding and have looked for this information in many
I have a HTML table with a column per row with this html code
I have a table in HTML. I have made this table as editable by
Do you have any suggestion for this particular problem. I have fairly complex html
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
I am building a html table dynamically with Javascript; This is my html table:
I have something like this in my AJAX application: <html> <head> <script type=text/javascript> var
I have a problem when converting a static html table to one which is

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.