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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:15:53+00:00 2026-05-20T06:15:53+00:00

I have a table like this; <table class=std-table> <tbody><tr> <td>DATA</td><td>DATA</td> </tr> <tr class=selected-trial> <td>DATA</td><td>DATA</td>

  • 0

I have a table like this;

<table class="std-table">
  <tbody><tr>
       <td>DATA</td><td>DATA</td>
  </tr>
  <tr class="selected-trial">
       <td>DATA</td><td>DATA</td>
  </tr>
  <tr>
       <td>DATA</td><td>DATA</td>
  </tr></tbody>

I also have a div on the same level that has an image (arrow) as it’s background:

<div class=selected-trial-marker></div>

The CSS is controls the basics of the marker element but what I haven’t assigned is top and left values. What I’m trying to do is when the page is ready use JQuery to find out the position of the ‘selected’ row and position the marker element to the right of it.

This is my code thus far:

$('table.std-table tbody tr.selected-trial td:last').ready(function(){
   var offset= $('table.std-table tbody tr.selected-trial').offset();
   var leftOffset = $('table.std-table').width();
       leftOffset += offset.left +42;
    var topOffSet = (offset.top);
        topOffSet = topOffSet+3;
    $('.trial-selection-marker').css({'top':topOffSet+'px', 'left':leftOffset+'px'}).fadeIn('slow');
});

I’m at a loss as my offset keep coming back as null. In my CSS the table has a width of 100% within a cell that is 300px but the TD cells themselves do not have a width assigned to them (does that matter as I’m targetting the row?) Perhaps I’ve stared at this for too long and the answer is obvious but can anyone please help?

Many thanks in advance.

  • 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-20T06:15:53+00:00Added an answer on May 20, 2026 at 6:15 am

    I see two issues:

    1. jQuery doesn’t like having a period in the table class name “table.std-table.”
    2. Your selector is missing a period.

    var offset= $(‘.table-std-table tbody tr.selected-trial’).offset();

    <table class="table-std-table">   
        <tbody>
            <tr>        
                <td>DATA</td>
                <td>DATA</td>   
            </tr>   
            <tr class="selected-trial">
                <td>DATA</td>
                <td>DATA</td>   
            </tr>   
            <tr>        
                <td>DATA</td>
                <td>DATA</td>   
            </tr>
        </tbody> 
    </table>
    <div class=.trial-selection-marker></div> 
    
    <script>
        $('.table-std-table tbody tr.selected-trial td:last').ready(function(){ 
            var offset= $('.table-std-table tbody tr.selected-trial').offset();    
    
            var leftOffset = $('tablestd-table').width();        
            leftOffset += offset.left +42;     
            var topOffSet = (offset.top);         
            topOffSet = topOffSet+3;     
            $('.trial-selection-marker').css({'top':topOffSet+'px', 'left':leftOffset+'px'}).fadeIn('slow'); 
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that looks like this: <table> <tr> <td class=packing-vol>0.19</td> <td class=qty-cell><input
I am writing a turbogears2 application. I have a table like this: class Order(DeclarativeBase):
I have a declarative table defined like this: class Transaction(Base): __tablename__ = transactions id
I have a table like this: Application,Program,UsedObject It can have data like this: A,P1,ZZ
I have a table like this... CustomerID DBColumnName Data 1 FirstName Joe 1 MiddleName
i have two table like this <table> <tr> <td> <select name=prueba id=prueba class=ddlStyles> <option
Quick js\jquery question. I have a table like this: <table id=test> <tr class=divider><td>Set 1</td></tr>
I have a table like this: id | name | class | marks 1
I have a basic Core data model like this: Class -Class Name (string) Relationship:
I have a HTML table like this: <table> <tr><td>X</td><td>X</td><td class='latest order1'>X</td><td class='latest order4'>X</td></tr> <tr><td>X</td><td>X</td><td

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.