What could be causing my table to malfunction in IE8?

Is it just me, or do my CSS tables not work on IE8?

<div class="main-table">
<div class="row">
    <a class="secondary-table" href="#">
        <div class="secondary-row">
            <div class="secondary-cell">
                $1000000000
            </div>
            <div class="secondary-cell">
                descrip<br /><span class="info">info</span>
            </div>
            <div class="secondary-cell" align="right">
                <button>View</button>
            </div>
        </div>
        <div class="secondary-row">
            <div class="secondary-cell">
                info
            </div>
            <div class="secondary-cell">
            </div>
            <div class="secondary-cell" align="right">
                <button>View</button>
            </div>
        </div>
    </a>
</div>

Here's the current CSS code:

body {
    background-color: #f8f8f8;
}

.main-table {
    display: table; 
    border: 1px solid #dcdcdc;
    height: 700px;
    background: white;
    table-layout: fixed;
    width: 100%;
}

.secondary-cell:first-child {
    width: 80px;
    max-width: 80px;
    word-wrap: break-word;
}

.secondary-table {
    display: table;
    table-layout: auto;
    border-bottom: 1px solid #eee;
    width: 100%;
}

a.secondary-table:hover {
    background-color: #f9f9f9;
}

.secondary-row {
    display: table-row;
}


@media screen and (min-width: 768px) {

.secondary-row:last-child {
    display: none;
}

}

@media screen and (max-width: 768px) {

.secondary-row:first-child .secondary-cell:last-child {
    display: none;
} 

.info {
    display: none;
    }

}

.secondary-cell {
    display: table-cell;
    padding: 10px;
}

.row {
    display: table-row;
}

.cell {
    display: table-cell;
}

http://jsfiddle.net/t9YaL/1/

Answer №1

Having <div> elements inside <a> elements is a common mistake. Although HTML5 allows this, older browsers like IE8 do not support it.

Instead of worrying about browser compatibility, focus on the structure of your table. A table should consist of cells within rows, all contained within the table element. Any other elements should be placed inside the cells themselves.

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

Combine collapse and popover in Bootstrap 3 for enhanced functionality

I'm facing some issues trying to use the badge separately from the collapse feature. $(function (e) { $('[data-toggle="popover"]').popover({html: true}) }) $('.badge').click($(function (e) { e.stopPropagation(); }) ) Check o ...

Adjust the primary scrolling section of a webpage to halt once it reaches a specific distance from the bottom of the viewport

I am facing a situation where I need to ensure that when scrolling down, a fixed pink menu bar at the bottom of the page does not overlap with the main blue content. This can be achieved by treating the blue content as an iframe positioned 60px from the bo ...

Using Bootstrap classes within a specified class declaration

Can you nest style classes within a single class? For example: .my-upper-class{ .hidden-md, .hidden-sm, .hidden-lg} ...

Issue with arranging cards in a grid when utilizing v-for alongside bootstrap

Just starting out with vuejs and attempting to create a grid by looping through objects using bootstrap classes. However, I'm running into an issue where the cards are not forming a grid as expected when utilizing the col classes. Below is the code f ...

Executing a Javascript function post AJAX page loading

I'm not a coding expert, so I hope my question is still clear. Essentially, I have an index.php page with filters (by project, year, month) that send variables to filterData.php after clicking submit. These variables are then used in SQL statements t ...

The issue with using the jQuery blur() event on a Div element

I am facing an issue with hiding specific popups that are based on divs. When I click outside those divs, they do not hide. Here is a sample code of what I am currently attempting: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "h ...

Text Module of the Divi theme

Issue Resolved (After noticing that Divi was adding padding twice to <ul>'s in their footer and Text Module, I created a new class to remove the padding-bottom from the sub-list item.) In a Divi text module, I created an unordered list with a s ...

Utilize various CSS styles for text wrapping

I'm struggling to figure out where to begin with this problem. My goal is to create a three-column row that can wrap below each other if they cannot fit horizontally. The height of the row should adjust to accommodate the items while maintaining a fix ...

Implementing a Popover Notification When Clicked

I'm a beginner at this. I came across an example of a popover message box in the link provided below. I attempted to implement it, but for some reason, it's not working. Could I be overlooking something? Alternatively, is there a simpler way to ...

I am encountering unexpected issues with the functionality of img srcset and sizes

Attempting to enhance the responsiveness of images on my website has led me to discover the srcset and sizes attributes. The objective is clear: If the screen size exceeds 600px or falls below 300px, a 250x250 image should be displayed For sizes in betw ...

I am looking to loop through an array nested within a JSON object and display it in a table column using

Within my JSON data, there is an array that I need to loop through in <td> tags. The functionality I am working on involves creating a table based on user input. The user specifies the number of rows, input columns, and output columns. I have three a ...

The functionality of Bootstrap Mobile css is most effective when navigating by scrolling downwards

I am experiencing a strange issue. I am using Ajax to load the Search form. The CSS is being applied correctly, but there is an unusual problem with the bottom margin. The bottom margin only appears when you scroll down in mobile view. When you load the f ...

Is it possible to set a unique identifier in Vue.js that persists even after the page is reloaded?

Currently, I'm working on a small project diving into Vue js - a Habittracker. Unfortunately, there is a bug in my code. When the page is reloaded and new habits are added, the function that should change the background doesn't work as expected. ...

Show or hide the right element when clicked using ng-show in AngularJS

My goal is to toggle elements based on which one is clicked, not all at once. For instance, if I have 3 form elements and 3 buttons, when I click on button 1, I only want to toggle the corresponding form element. Here is my current code snippet: In Angu ...

Locate the hyperlink within a div using JavaScript and navigate to it

I stumbled upon an element (div1) and now I am looking for a link within that element (link) so that I can navigate to it. <div class="div1"> <p> <a href="link">Link</a> </p> </div> ...

Unable to establish a hyperlink to specific section of page using MUI 5 Drawer

When attempting to link to a specific part of my first page upon clicking the Shop button in the navigation Drawer, nothing happens: https://i.stack.imgur.com/FUQCp.png This snippet shows the code for the MUI 5 Drawer component: <Drawer anch ...

The class of each page on the website keeps changing, making it a challenge for me to scrape the page descriptions

import requests from bs4 import BeautifulSoup import numpy as np import re import json title = [] pages = np.arange(1,13) for page in pages: url = 'https://www.jobs.ch/en/vacancies/?page='+str(page)+'&term=python%20web' p ...

Use jQuery to permit only numeric characters and the symbol "-" to be entered into a textbox

I have been working on a JQuery script that only allows users to input numbers in a text field. However, I am now trying to modify the code to also allow users to enter "-" (hyphen), but so far it's not working as expected. If anyone can provide assis ...

What is the best way to center my dropdown menu on the page?

Discover my exclusive menu by visiting this link. For those who are curious about the source code, here's the HTML snippet: <div id='menu-container'> <ul id='menu' class="menu"> <li class='active'>& ...

Attempting to use jQuery AJAX to submit data without navigating away from the current webpage

Trying to implement the solution provided in this post where I am trying to send data to a PHP page and trigger an action, but unfortunately, it seems to just refresh the page without any visible outcome. Even after checking the network tab in the element ...