You created a new stacking context with td { position: relative }
and without specific height/width values IE thinks it has zero height/width.
Simply remove td {}
and modify your video {...}
as noted in the snippet (actually remove the stacking context) and you will see IE works as expected.
Apparently more modern browsers have solved this issue.
This will be hard to test through Stackoverflow as SO (oddly enough) no longer supports IE11...
body {
margin: 0;
}
#main {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
flex-direction: column;
background: red;
}
#header {
background: yellow;
}
#content {
background: gray;
flex: 1;
min-height: 0;
}
table {
width: 100%;
height: 100%;
background: blue;
color: white;
}
/* *** REMOVE ***
td {
position: relative;
}
video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}*/
/* *** KEEP *** */
video { width: 100%; height: 100% }
<div id="main">
<div id="header">Header</div>
<div id="content">
<table>
<tr>
<td>
<video controls>
<source src="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4" type="video/mp4">
</video></td>
</tr>
</table>
</div>
</div>
UPDATE
For your convenience I added a more extensive snippet showing a table with multiple columns and rows. Disabled table width/height
, added table border-collapse
and a demo td {...}
, again without position: relative
. Tested to work in IE11 (9,10 mode too).
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SO 60492668</title>
<style>
body {
margin: 0;
}
#main {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
flex-direction: column;
background: red;
}
#header {
background: yellow;
}
#content {
background: gray;
flex: 1;
min-height: 0;
}
table {
/* width : 100%; /* temporary disabled */
/* height: 100%; /* temporary disabled */
background: blue;
color: white;
border-collapse: collapse; /* ADD */
}
/* *** REMOVE ***
td {
position: relative;
}
video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}*/
/* *** KEEP *** */
td { border: 1px solid rgba(0,0,0,.3); padding: .5rem } /* DEMO */
video { width: 100%; height: auto; max-width: 20rem }
</style>
</head>
<body>
<div id="main">
<div id="header">Header</div>
<div id="content">
<table>
<tr>
<td>column 1</td>
<td>column 2</td>
<td>column 3</td>
<td>
<video controls>
<source src="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4" type="video/mp4">
</video></td>
<td>column 5</td>
</tr>
<tr>
<td>column 1</td>
<td>column 2</td>
<td>column 3</td>
<td>
<video controls>
<source src="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4" type="video/mp4">
</video></td>
<td>column 5</td>
</tr>
<tr>
<td>column 1</td>
<td>column 2</td>
<td>column 3</td>
<td>
<video controls>
<source src="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4" type="video/mp4">
</video></td>
<td>column 5</td>
</tr>
<tr>
<td>column 1</td>
<td>column 2</td>
<td>column 3</td>
<td>
<video controls>
<source src="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4" type="video/mp4">
</video></td>
<td>column 5</td>
</tr>
</table>
</div>
</div>
</body>
</html>