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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:15:03+00:00 2026-06-18T16:15:03+00:00

I have a table set up as such: <table id=Table class=sortable> <col class=quantity></col> <col

  • 0

I have a table set up as such:

<table id="Table" class="sortable">
<col class="quantity"></col>
<col class="price"></col>
<col class="total"></col>
<thead>
<tr>    
<th class="right">Quantity</th>
<th class="right">Price</th>
<th class="right">Total</th>
</tr>
</thead>
<tbody>

<tr>
<td class="right">50,000</td>
<td class="right" sorttable_customkey="10.25">10.25</td>
<td class="right" sorttable_customkey="512500">512,500</td>
</td>
</tr>

<tr>
<td class="right">1,250</td>
<td class="right" sorttable_customkey="8.1">8.10</td>
<td class="right" sorttable_customkey="101125">101,125</td>
</td>
</tr>
</tbody>
</table>

Using JavaScript, how can I hide rows based on the quantity of one or more cells? Like if (the price is less than 5), or (the price is less than 10 and quantity is greater than 1,000), have the whole row skipped over.

  • 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-18T16:15:05+00:00Added an answer on June 18, 2026 at 4:15 pm

    I’m only answering this because the horrendous jQuery answer needs to have a substitute.

    Place the following in a <script> tag anywhere after the table:

    (function() {
        var tbl = document.getElementById('Table'),
            rows = tbl.tBodies[0].children, l = rows.length, i,
            filter = function(cells) {
                var values = [
                    parseInt(cells[0].firstChild.nodeValue.replace(/,/g,''),10),
                    parseFloat(cells[1].firstChild.nodeValue.replace(/,/g,'')),
                    parseFloat(cells[2].firstChild.nodeValue.replace(/,/g,''))
                ];
                // THIS IS WHERE YOUR CONDITIONS GO
                if( values[1] < 5) return false;
                if( values[1] < 10 && values[0] > 1000) return false;
                return true;
            };
        for( i=0; i<l; i++) {
            if( !filter(rows[i].cells)) rows[i].style.display = "none";
        }
    })();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table set up to hold folders. Each folder has an ID
I have a table set up as follows id origin destination carrier_id so typical
We have a table set up as follows: |ID|EmployeeID|Date |Category |Hours| |1 |1 |1/1/2010
I have a mysql table field set as time type which stores data in
I have a table with white-space set to nowrap and columns widths restricted using
I have a table that displays a set of data. But when I try
I have a table that containts a set of columns one of it is
I have a MySQL database where the table was set up to store the
I have a table with a field: 'last_modified - timestamp NOT NULL' I set
I have a nested class such as : public class Jar { public IEnumerable<NailClippings>

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.