"Freezing a column in an HTML table causes a disruption in

I'm struggling to make the layout of the following link work properly: http://jsfiddle.net/Tc5Xk/

Could someone offer assistance with this?

div.dashboardBox {
 border: 1px solid #999999;
 width: 45%;
 margin-right: 20px;
 margin-bottom: 20px;
 float: left;
}
div.dashboardBoxBody {
 padding: 8px;
 height: 200px;
 overflow: auto;
 margin-left : 5em;    
}
table.standardTable {
  position: static;
  width: 95%;    
}
.standardTable th {
 font-size: 11px;
 background-color: #888888;
 color: #FFFFFF;
 font-weight: bold;
 text-align: left;
 border: 1px solid #AAAAAA;
}
#header_detail {
  text-align: left;
  position:absolute;    
  left : 0;    
}
<div class="dashboardBox">
<div class="dashboardBoxBody">
    <table style="width:200%" class="standardTable">
        <tr>
            <th id="header_detail">Location</th>
            <th id="header">Jan-13</th>
            <th id="header">Feb-13</th>
            <th id="header">Mar-13</th>
            <th id="header">Apr-13</th>
            <th id="header">May-13</th>
            <th id="header">Jun-13</th>
            <th id="header">Jul-13</th>
            <th id="header">Aug-13</th>
            <th id="header">Sep-13</th>
            <th id="header">Oct-13</th>
            <th id="header">Nov-13</th>
           <th id="header">Dec-13</th>
        </tr>
       ... Additional content truncated for brevity ...
        </tr>
    </table>
</div>

Answer №1

The issue lies within this specific line of code

#header_detail {
    text-align: left;
    position:absolute;  // This particular line   
    left : 0;    
}

By removing the position: absolute; declaration, you will be able to see all cities in your area.

Check out the JsFiddle link for more details

Answer №2

div.dashboardBoxBody {
 padding: 8px;
 height: 200px;
 overflow: auto;
 // margin-left : 5em;    
}

#header_detail {
  text-align: left;
  // position:absolute;   
  left : 0;    
}

To achieve the desired result without overflow, it is recommended to eliminate both the absolute positioning AND the left margin from your div.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Setting up a CSS Grid development environment for Windows users

Currently, I am looking to update my website development environment. Despite using Adobe Dreamweaver out of habit, I need a more efficient setup that can offer the following: An editor with syntax highlighting, code/tag completion, and code hints for wr ...

Issue with setting background image height to 100% or 100vh

Seeking help to address the issue of the URL field impacting the total height. Any assistance would be greatly appreciated. body,html { height:100% } Issue arises when there is a display in the address bar. .bg { min-height:100% background-size: cover; ...

Tips for adjusting the slider label to move horizontally to match the width of the slider using CSS

Is it possible for the label of the slider to smoothly slide along the X axis to adjust to the current width of the slider? I have demonstrated this effect in a gif. It's a bit challenging to describe in words, so please watch the gif to grasp what I ...

Struggling with the alignment of pictures inside a container

I utilized the Instafeed.js library to fetch the three most recent images from an Instagram account. These images are loaded into a specific div and I successfully customized their styling according to my requirements. However, the current setup is quite s ...

Leveraging the power of PHP includes with nested subdirectories

Hello, I recently configured my web server to run all .html files as .php files, allowing me to utilize the php include function, which has been very beneficial. However, I have various subdirectories with multiple files in each one. Homepage --banners ...

Chrome: Box-shadow not visible on images with a background present

Recently, I have noticed an issue with the box-shadow not displaying on images with a background on my website. This problem started occurring in Chrome a few months ago, despite working perfectly fine around six months ago. To pinpoint the problem, I cre ...

External elements - My physical being is in a state of chaos

Hello there, I hope everything is well with you. I have been working on creating a form using MaterializeCss to calculate an invoice for a craftsman. The user is required to input a number or select an item. Everything seems to be going smoothly so far. ...

The appearance of the webkit-scrollbar is not reflecting the intended style

I have successfully created a wrapper for a styled scrollbar in React JS - import styled from '@emotion/styled'; export const ScrollbarWrapper = styled.div(() => ({ maxHeight: '65vh', overflowY: 'auto', '*::-web ...

When the browser is resized to smaller than the minimum width specified, the div element fails to center

I'm in the process of trying to center a div element. The div has a width of 400pt, while the body must have a minimum width of 500pt in order to leave at least a 50pt space around the div. Here is an example of my code: <html> <style> ...

upright scrolling mouse slider

In my project, I have implemented a vertical slider with mousewheel control using SwiperJS from https://swiperjs.com/. Although the slider is working perfectly fine, I am looking to fix the positions while scrolling on the page similar to the example pro ...

AngularJS static list with dynamically changing content

Seeking inspiration on creating an AngularJS information monitor with a maximum of 6 rows. The display should show new rows at the top, pushing out the oldest row from the bottom when there are already 6 rows visible. Rows can also disappear unexpectedly. ...

The Bootstrap navigation bar is having issues toggling

As someone new to Bootstrap, I am seeking the guidance of experienced individuals to help me identify where I may be going wrong. My goal: I am currently developing a responsive website using Bootstrap. I want my navbar to remain fixed at the top and, whe ...

The spacing between images on mobile devices is excessive

My images on mobile have too much space between them: mobile version They appear fine in Dev Tools: dev tools version This is my HTML: <div class="container-fluid"> <!-- <br> --> <div class="row"> ...

Adjust the width of the mosaic layout to a 50% / 50% ratio

I'm looking to adjust the layout so that each image occupies 50% of the page. Currently, one large image takes up 2/3 of the space and two smaller images take up the remaining 1/3. You can find the images here: To make the large image occupy 50%, yo ...

Use jQuery to apply a class to some input elements when certain events like keyup or

If I type something in the input field, it should add a border to the li tag containing the text. The current script works fine, but is there a way to make this jQuery script shorter? Thank you for your help! .add_border{ border: 2px solid #000 !impor ...

Learn how to create a series of table rows using CSS, followed by another series of table rows

I have an array of tables, each with a size of 6 x 6, and a placeholder. My goal is to arrange these tables in the placeholder so that they appear in rows of 6 next to each other. I am unsure about which CSS properties to apply to achieve this layout. Lit ...

Trigger an immediate repaint of a DOM element in the browser

Searching for a way to insert a large HTML markup into a DOM element that will take some time. This is why there's a need to display a preloader indicator before the process begins. Two blocks are involved: #preloader and #container. Initially, the pr ...

Instantly appearing and disappearing Bootstrap modal popup catches users off guard

I've encountered an issue with my bootstrap popup that displays student results - it opens and closes immediately. In my master page file, I have included the following JS files: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="ser ...

I am currently in the process of creating a website navbar with HTML and Tailwindcss, but unfortunately, I am running into issues with the desired functionality not being

Even after trying the group-hover:block technique, I am still unable to see the dropdown menu when hovering over the solution and resources. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

Is the button not aligned properly with the email input field?

<div class="subscribe__form--action--btn"> <form action="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="32545b5e5b5746545C5B5356477F54585850"> </a>" meth ...