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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:47:33+00:00 2026-06-04T23:47:33+00:00

i have a table like this in my html page <table id=mytable> <tr id=classified>

  • 0

i have a table like this in my html page

<table id="mytable">
  <tr id="classified">
    <td>1</td>
  </tr>
  <tr id="unclassified">
    <td>0</td>
  </tr>    
</table>

so, on the document.ready i want to check which column has 0 value, if value is o then hide that row,

i have written this code but doesnt seem to work

$(document).ready(function IsValidTableContent() {
    $('#mytable tr td').each(function () {
        if ($(this).val() == 0) {
            $(this).hide();
        } else {
            $(this).show();
        }
    });
});
  • 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-04T23:47:36+00:00Added an answer on June 4, 2026 at 11:47 pm

    You can locate that td with :contains():

    $("#mytable td:contains(0)");
    

    Fiddle: http://jsfiddle.net/UCgSL/

    Warning:

    If you have other cells that contains 0, but aren’t exactly equal to 0, :contains will include those in the matches as well. This would mean that 100 or 1,000 could also show up since those also contain 0. If you want only those whose values are 0, and nothing else, you should consider using a filter:

    $("#mytable td").filter(function(){
      return $(this).text() == 0;   
    });
    

    Fiddle: http://jsfiddle.net/UCgSL/1/

    Custom Filter Selector

    If using .filter is too verbose, you could roll your own filter selector:

    $.expr[":"].exactly = function( e, i, m ) {
        return $(e).text() == m[3];
    };
    
    $("#mytable td:exactly(0)");​
    

    Fiddle: http://jsfiddle.net/UCgSL/2/

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

Sidebar

Related Questions

I have a html page that contains a structure like this: <table class=pick> <tr>
I have a PHP page that returns an HTML table like this: <table> <tr>
In my html page, i have links like this <table width=100% border=0 cellspacing=4 cellpadding=4>
Let's say I have following table like this <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
I have a html table like this: Invoice# Due Date Balance Select 12345 12/25/2011
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have a simple table like this <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
A newbie question,really. Suppose I have a html table like this: <div id=div1> <table
I have an html table that looks like this in a standard HTML 4.01

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.