Problems with table in IE

Asked

Viewed 132 times

3

In IE, the cells of the tbody do not accept CSS values.

td:first-child{
  width: 52%;
}

I created a jsFiddle with the table html/css:

http://jsfiddle.net/rqj6r/1/

  • Which version of IE?

  • I’m testing on IE 9

  • I never came across one of those, good to know!

  • 1

    Marcelo, did you find the solution to the question or did you put a patch here and find the correct solution/defective? In the case of the first then it is better to remove the answer from the question and put a new answer and accept it.

3 answers

3

Try to add this goal:

<meta http-equiv="X-UA-Compatible" content="IE=9" />

Tried to use the hacks?

Have some here:

#element {
    color:orange;
}
#element {
    *color: white;    /* IE6+7, doesn't work in IE8/9 as IE7 */
}
#element {
    _color: red;     /* IE6 */
}
#element {
    color: green\0/IE8+9; /* IE8+9  */
}
:root #element { color:pink \0/IE9; }  /* IE9 */

Source: http://jsfiddle.net/ENp5A/

  • I tried using width: 52% 0/IE8+9; but nothing happened.

  • 1

    I’m already using <meta http-equiv="X-UA-Compatible" content="IE=edge">

3

Your document is tagged <doctype> well-defined?

Try using the doctype, which triggers the "default mode" in IE, for example <!doctype html>, which should be inserted at the beginning of the HTML document.

The pseudo class :first-child is one of many CSS tools that are not supported by IE in "Quirks Mode". See more about Quirks Mode in http://en.wikipedia.org/wiki/Quirks_mode.

See also the Microsoft documentation on this topic: http://msdn.microsoft.com/en-us/library/ie/cc848865%28v=vs.85%29.aspx

Source: https://stackoverflow.com/questions/12383068/tdfirst-child-does-not-seem-to-work-in-ie

1

RESOLVED

The problem was in the :before

tbody:before {
  line-height:10px;
  content:"-";
  color: transparent;
  display:block;
}

I switched to:

tbody:before {
  height:10px;
  content:"";
  display:block;
}

This eliminated the gap between thead and tbody in IE, but at least corrected the table.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.