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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:51:21+00:00 2026-06-13T04:51:21+00:00

I have a table (jqGrid) and I’d like to add a small icon/image before

  • 0

I have a table (jqGrid) and I’d like to add a small icon/image before a row dynamically on document load. The image will be inserted based on one of the grid’s hidden column values (date); it is supposed to mark the importance/urgency of the row to the page/grid viewer. I’m well versed with jQuery and I have the logic down but the only thing I’m having trouble with is where in the DOM structure this element should be inserted because it shouldn’t be part of the actual grid. It should float just to the left of the row outside the grid. So basically, what I’m asking is this:

1) Where in the DOM structure should this element be inserted? The div container containing the actual table?;

2) How should it be styled (CSS)?

The only approach I’ve come up with is to get the y-coordinate of the row in question and insert it in the div container (that contains the table) set to that y-coordinate. I’m not sure if this is the best or right way to go about it.

EDIT: Lots of good approaches here. I’m thinking of combining the “afterInsertRow” event with David’s approach. Thank you all for your 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-13T04:51:23+00:00Added an answer on June 13, 2026 at 4:51 am

    Why add any elements to the outside of the table? Just use hidden cells to contain the image/element you want to show and style in response to the :hover of the parent tr, given the mark-up:

    <table>
        <thead>
            <tr>
                <th></th>
                <th>Column 'one'</th>
                <th>Column 'two'</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td></td>
                <td>row one</td>
                <td>row one</td>
            </tr>
            <tr>
                <td></td>
                <td>row two</td>
                <td>row two</td>
            </tr>
        </tbody>
    </table>
    

    And the CSS:

    tr th:first-child,
    tr td:first-child {
        visibility: hidden;
        border: 0 none transparent; /* hide the borders */
        width: 1em; /* define the width, to avoid the visible content */
    }               /* causing page-jumps */
    
    tr th:first-child + th,
    tr td:first-child + td {
        border-left: 2px solid #000; /* style the cell *after* the first-child */
    }                                /* with a border to 'fake' the look of the */
                                     /* new content being appended outside */
    td, th {
        visibility: visible;
        border: 1px solid #000;      /* show borders to continue the illusion */
        height: 2em;                 /* or whatever... */
        line-height: 2em;
    }
    

    This approach seems to work (and should work in IE as well, I think): JS Fiddle demo,

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

Sidebar

Related Questions

I have the below jqgrid image, from which I would like to remove the
I have JqGrid with RadioButton per each row like this. ... { name: 'select',
I have a table using jqGrid, I need that when editing a row some
i have a problem in my jqgrid table: i load the json, i have
in my jqgrid i have field in a table which represents the id and
I have a problem with the jqgrid Date formatter. in my DB table i
I have a JQGrid plugin in my website, the table is loading OK, but
I have rows from a table in jqGrid. I manipulate the behaviour of cellEdit
I need some help with jqGrid. I have a table with the primary key
I have a table (jqGrid) inside one of the jquery ui tabs (the first

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.