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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:59:39+00:00 2026-06-08T08:59:39+00:00

I am in a special problem here. Ti accommodate a request from a client

  • 0

I am in a special “problem” here. Ti accommodate a request from a client I need to do the following. Run through all tables on a page. For each table check if it has exactly 2 TD’s. If it does then I need to make a “read more” implementation.

I have used this on another page where I know the exact div’s I want to collapse and expand.

$(".more-block").each(function(){
    if ($(this).height() > adjustheight){
        id = this.id;
        id = id.split("_");
        $("#expand"+id[1]).toggle(function() {
                id = this.id;
                $(".more-block"+id).css('height', 'auto').css('overflow', 'visible');
                $('html, body').animate({scrollTop: $(document).height()}, 'slow');
                $("#"+id).attr('src',path+'/images/expand2.png');
                $(".frontpage_box").css('height', '');
            }, function() {
                id = this.id;
                $("#"+id).attr('src',path+'/images/expand.png');
                $(".more-block"+id).animate({height: adjustheight}, "slow", function(){
                    $(".more-block"+id).css('height', adjustheight).css('overflow', 'hidden');
                });         
        });
    };
});

$(".more-block").css('height', adjustheight).css('overflow', 'hidden');

Any ideas?
When I run through the TD’s I could just add the classes “more-less” and “more-lessexpand1” (number is increment). Is this possible? I am not sure how to run the tables and only do this if two TD’s is found and only do this last bit on the second TD.

Oh and by the way… its important its only the second TD that collapses and expands. The left one is not allowed to. I might be able to solve this last bit if someone could help me find the TD’s of interest.

Please help

  • 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-08T08:59:40+00:00Added an answer on June 8, 2026 at 8:59 am

    ” I might be able to solve this last bit if someone could help me find the TD’s of interest.”

    Something like this will find the table(s) of interest, assuming you don’t have nested tables:

    $("table").each(function() {
       var $tds = $(this).find("td");
       if ($tds.length != 2)
           return;
       // this is a table with exactly two cells, so do something
       // $tds.eq(0) will reference first td;
       // $tds.eq(1) will reference second td;
       // So to add the classes to the second cell...
       $tds.eq(1).addClass("more-less more-lessexpand1");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following problem. I want to escape all special characters in a
i've already read all tha articles in here wich touch a similar problem but
Here is problem I'm trying to solve. It's for logistics company. I got all
In SQLSERVER/MSSQL, here's the problem: SELECT * from [Translation Color] order by [Language Code]
I read many entries, but I found no solution for my (special?) problem. Here
Strange problem here, I have a page with 4 ControlTemplates declared in the page
I have a problem parsing a XML file which contains special characters like ,
Im having a small problem with storage of special characters like quotes, double quotes
I've got a huge problem. I made a special ID for the things in
i feel my beard growing while trying to find out the Problem here. Basic

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.