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

  • Home
  • SEARCH
  • 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 6821759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:34:58+00:00 2026-05-26T21:34:58+00:00

What I am trying to do is take the last colomn in a table

  • 0

What I am trying to do is take the last colomn in a table placed into a new table altogether. I got this working the problem is I want this to work for multiple tables with the same class names. Right now it only takes the first tables cols and repeats them. I have an idea of why but I am not sure how to target each table as an individual element even though they all have the same class name.

jquery

function fixLastColumn() {                
// makes new table 
     var nt = $('<table class="ft_fixedTable"></table>');

     $(".ft_FixedTable tr").each(function(i) { 
        nt.append('<tr class="ft_fixTR"><td class="ft_fixTD">'+$(this).children('td:last').html()+'</td></tr>')
     })
    nt.appendTo('.fixedDiv');

    // remove last column
    $('.ft_FixedTable tr').each(function(i) {
   $(this).children('td:last').remove();
     });
   }

$(document).ready(function() {
    fixLastColumn();
 });

html

<table class="ft_FixedTable">
    <thead> 
        <tr>
        <td>Title 1</td>
        <td class="ft_fixedCol">fixed one</td></tr>
    </thead>
    <tr>
    <td>Content Content Content Content Content</td>
    <td>Fixed content </td>
    </tr>
</table>

<div class="fixedDiv"></div>
  • 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-05-26T21:34:59+00:00Added an answer on May 26, 2026 at 9:34 pm

    You can use JavaScript to move the table cells themselves instead of just copying the contents:

    function fixLastColumn() {
        // makes new table 
        var nt = $('<table id="ft_fixedTable_2" />');
    
        $(".ft_FixedTable tr").each(function(i) {
            $('<tr class="ft_fixTR"/>')
                .append($(this).children('td:last'))
                .appendTo(nt);
        })
        nt.appendTo('.fixedDiv');
    }
    
    $(document).ready(function() {
        fixLastColumn();
    });
    

    As a (small but potentially significant) optimization, however, you should use IDs instead of classes to identify your tables and divs:

    http://jsfiddle.net/mblase75/TVpHp/

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

Sidebar

Related Questions

I'm trying to take this string where lowercase(pdd.last_name) like 'albert%' and replace pdd with
trying to take this content: <div class=content>one,two,three</div> <div class=content>four,five,six</div> <div class=content>seven,eight,nine</div> and .split and
I'm sure there's a really easy way of doing this. I'm trying to take
I have updated this question(found last question not clear, if you want to refer
I am trying to take input from the user and want to compile regex
i am trying to an insert statement using last_insert_id() , i want to take
Got this table in SQL Server 2005, which is used to maintain a history
Having been playing around with C# the last few days and trying to take
I have a datagridview with 9 columns. I am simply trying take the value
Im trying to take a link either when clicked or hover over be able

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.