Difficulty in aligning tables with absolute positioning in Internet Explorer compared to Chrome

Encountering an issue with the alignment of elements when using position: absolute; across multiple browsers.

In Chrome, everything appears properly aligned within the table. Refer to the following link for a visual:

https://i.sstatic.net/qhrAi.jpg

However, in IE (11), there seems to be a discrepancy in the alignment of column tops. You can view the issue in the provided link:

https://i.sstatic.net/GgSpB.jpg

The first column is set as absolute positioning to remain fixed while scrolling horizontally. The horizontal scrolling function works well in both browsers, but the aesthetics are disrupted in IE.

Here is the CSS styling being used:

<style type="text/css">
.tg  {
    border-collapse:collapse;
    border-spacing:0;
    }

.tg td{
    font-family:Arial, sans-serif;
    font-size:14px;
    padding:10px 5px;
    border-style:solid;
    border-width:1px;
    overflow:hidden;
    word-break:normal;
    }

.tg th{
    font-family:Arial, sans-serif;
    font-size:14px;
    font-weight:normal;
    padding:10px 5px;
    border-style:solid;
    border-width:1px;
    overflow:hidden;
    word-break:normal;
    }

.tg .tg-941l{
    background-color:#ffc000;
    text-align:center;
    vertical-align:middle;
    }

.tg .tg-huo5{
    background-color:#ffc000;
    vertical-align:middle;
    }

.tg .tg-Sidebar{
    background-color:#ffc000;
    vertical-align:middle;
    position: absolute;
    }

.tg .tg-yw4l{
    vertical-align:top;
    }
</style>

Showcased below is the beginning of the table structure along with the first td:

<table class="tg" style="undefined;table-layout: fixed; width: 1290px">
<colgroup>
<col style="width: 100px">
<col style="width: 58px">
<col style="width: 181px">
<col style="width: 62px">
... (more col styles here)
</colgroup>
  <tr>
    ... (table headers here)

  <tr>

      <td height="49" width="90" class="tg-Sidebar"><b> BC-700 </b></td>
    ... (table data here)
    
  </tr>

Any insights or feedback on this issue would be highly appreciated.

Thank you in advance for your assistance!

Answer №1

It is unnecessary to include 'position: absolute' in the CSS class '.tg .tg-sidebar' for responsive tables. Removing this style declaration will not affect the table's responsiveness.

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

Sending a PHP object as the value of an HTML radio button

When dealing with a custom object that needs to be passed as a form value in a radio button selection, the usual method involves invoking the toString() function on the object. However, this simply converts the object to a String, which may not be ideal fo ...

I possess a compilation of URL links and I am seeking to identify the specific HTML div that corresponds to each URL within a webpage

Could you please help me figure out which HTML div each URL belongs to on a webpage using Java? I have a list of URLs that need to be matched with their respective HTML divs. ...

Organize objects neatly in a grid formation

I have a .test div with grid-template-columns: auto auto auto;. The column width is set to vary based on the element width, and I also used justify-content: start; to align the columns to the left. I chose to use auto instead of 1fr to prevent the columns ...

Having trouble locating the CSS and JavaScript files within my Spring Maven project

I have a Spring framework application with a Maven project. In addition, I have CSS and JavaScript files under the WEB-INF folder. When attempting to link the JavaScript and CSS files like this: <link rel="stylesheet" href="../allDesign/js/vendor/anims ...

How Web Components interact with innerHTML within connectedCallBack

class Form extends HTMLElement { constructor() { super() } connectedCallback() { console.log(this) console.log(this.innerHTML) } } customElements.define("my-form", Form); I'm currently faci ...

The material UI Paper component appears to be extending beyond the boundaries of the background image

I have configured the Grid component to occupy 6 on small/medium screens for a side-by-side layout and 12 on xs screens for each item. While everything looks fine in the computer view, I am facing an issue with the mobile view where the paper component is ...

Looking to retrieve the value of an input element within an ng-select in Angular 6?

Currently, I am working on a project where I aim to develop a customized feature in ng-select. This feature will enable the text entered in ng-select to be appended to the binding item and included as part of the multiselect function. If you want to see a ...

Scrape dynamic web data with JSOUP

Having trouble grabbing the price? I cannot seem to get any output for the price and its weight. I've attempted different methods, but nothing is working Document doc = Jsoup.connect("https://www.jakmall.com/tokocamzone/mi-travel-charger-20a-output- ...

Transition animation using jQuery

I am seeking assistance with jQuery effects. Specifically, I have set images to a certain position using style, and I want users to be able to drag these images around once the HTML page is published. Is there a plugin or command in jQuery that will allow ...

The value returned by $_GET is always 1

I'm struggling with passing a GET variable to another PHP page. My issue involves deleting rows from a table of content using AJAX. The Ajax function works flawlessly on a simple example with a form. Here is the code snippet: while($row=mysql_fe ...

Displaying an Array in HTML using Angular

Just starting out with Angular and experimenting with data display from an array. The data in the array is: [Me, Three, Four] I attempted to loop through it for printing but encountered issues. Here's a snippet of how I'm currently handling it: ...

Having trouble resolving a setInterval problem with JavaScript?

Yesterday, I learned about the setInterval function which allows me to execute a task or function after a specific amount of time. While I have successfully implemented the interval in my code, it keeps adding new lines with the date each time. What I re ...

Tips for adjusting the close date based on the selected date in a dropdown datepicker

Here is a sample code snippet: <input id="date1" name="start_date" id="dpd1"/> <select class="form_line_only form-control" name="ho_night"> <option selected> 0 </option> <option ...

Top method for stacking several divs in a vertical line

In search of the most effective method for organizing numerous dynamically generated divs (all with identical widths) in a vertical stack, two potential solutions have emerged: Utilize float:left... Implement an unordered list and enclose each div within ...

Entering numerous numerical values across a variety of input fields

My website currently has a form with 6 input fields where visitors need to enter a 6 digit code. To make it easier for them, I want to allow users to simply paste the code we provide into the first input field and have the remaining digits automatically po ...

How can I turn off the animation for a q-select (quasar select input)?

I'm just starting out with Quasar and I'm looking to keep the animation/class change of a q-select (Quasar input select) disabled. Essentially, I want the text to remain static like in this image: https://i.stack.imgur.com/d5O5s.png, instead of c ...

Step by step guide on inserting View and Delete buttons in an HTML table populated by JSON data

I've successfully loaded data from a JavaScript file in JSON format into a plain HTML table using JavaScript. Everything is working well so far. I now want to enhance the table by adding two buttons, View and Delete, that when clicked will redirect to ...

Presentation and selection list

Here is the CSS code I am using: .nav li a { background-color:#000; color:#fff; text-decoration:none; padding:10px 15px; display:block; } .nav > li { float:left; } .nav li a:hover { background-color:#4db4fa; } .nav li ul { ...

What could be causing the incorrect value of the endpoint of an element when utilizing a function?

By adding angles individually and then using ttheta (without calling a function to add angles and then using ttheta), the problem is resolved. However, can anyone explain why using a function here is incorrect or identify the issue that this function is ca ...

Replacing menu styling with JavaScript using C#

I'm currently working on a C# project to develop a smartphone-friendly website for motorists to easily pay their parking fees. However, I'm facing some challenges with the menu design. My goal is to have a white menu with black text, where the cu ...