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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:11:27+00:00 2026-05-21T18:11:27+00:00

I am trying to position a span element relative to the upper-right corner of

  • 0

I am trying to position a span element relative to the upper-right corner of a table object.

This table may be wider or move around based on what the user does on the tool, so I was looking for something simpler than the jQuery.position method. I was hoping to do something elegant with CSS.

I’ve built a small example of my dilemma in jsfiddle: http://jsfiddle.net/xerf/ZSGfc/

<div>
    <table>
        <thead>
            <tr>
                <th colspan="3">Title</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Stuff 1</td>
                <td>Stuff 2</td>
                <td>Stuff 3</td>
            </tr>
            <tr>
                <td>Stuff 1</td>
                <td>Stuff 2</td>
                <td>Stuff 3</td>
            </tr>
            <tr>
                <td>Stuff 1</td>
                <td>Stuff 2</td>
                <td>Stuff 3</td>
            </tr>
        </tbody>
    </table>
    <span>&times;</span>
</div>

Below are the CSS Styles

body
{
    font-family:sans-serif;
}

table
{
    border-collapse: collapse;
    border: 1px solid black;
    margin: 20px;
}

th
{
    padding: 6px;
}

td
{
    padding: 3px;
    border: 1px solid black;
}

UPDATE: Added some images to show required positions:

Scenario 1

Needs to be where the red Square appears above

  • 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-21T18:11:27+00:00Added an answer on May 21, 2026 at 6:11 pm

    I wrapped your span in a div and placed it in the <th> with your title:

     <th colspan="3"><div id="container">Title
                        <span>&times;</span></div></th>
    

    css:

    #container{
        width:auto;
        height:auto;
        position:relative;
    }
    span{
        position:absolute;
        right:0px;
        top:0px;
    

    Here is a demo: http://jsfiddle.net/ZSGfc/6/

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

Sidebar

Related Questions

I am trying to position a <span> relative to a particular image. I must
I am trying to position an span element (let us call it the tooltip
I am trying to position a dialog box right under a + (plus) sign.
I am trying to position this sale banner over the image. The red border
What I am trying to do is position a list element over an inline
Possible Duplicate: Does Firefox support position: relative on table elements? Does Firefox ignore relative
I'm having headaches trying to make this work: I have a <a> element with
I am trying to retrieve the position of an HTML element inside a paragraph.
I'm trying to display a span overlapping a canvas element along the canvas' left
I'm trying to overwrite the style of some element of jquery ui, this is

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.