1

I'm writing some HTML to be inserted into a page. The current structure is something like this:

<table>
 <tr>
  <td rowspan="2">left column</td>
  <td height="1">top row above content</td>
 </tr>
 <tr><td height="220">my content here</td></tr>
</table>

I have complete control over the table but nothing else. What I want to do is to have a the content fill the entire cell. I have gotten the width, but I can't get the height right.

Some things I have tried are:

  • Setting the height to 100%.
  • Attributes like height=200.
  • Giving the content absolute positioning. This unfortunantly made it fill the page instead of the cell.

The main problem that I haven't solved is because of the left column and content varying in height. When the left column is larger than the content it won't expand. Unfortunantly, fixed height iQsn't an option because it isn't responsive.

How can I make the content fit the the entire table cell?

David Archibald
  • 1,431
  • 14
  • 27
Rena
  • 3,923
  • 3
  • 22
  • 19
  • In which browser doesn't `height: 100%` work? I tried FF 3.6, Opera 11, IE8 and Chrome 8, and they all happily fill the entire height of the td ( http://jsfiddle.net/nQfGV/ ). – Frode Jan 15 '11 at 14:02
  • This shows the problem (copied from above example and added some attributes from the actual page): http://pastebin.com/HnHumG2X In both Firefox and Opera the blue box doesn't occupy its entire container because the large red box expands it. – Rena Jan 16 '11 at 05:08
  • What do you mean by "div fill the entire cell", do you mean content completely filling each table cell? – David Archibald Jan 02 '17 at 22:50
  • Also please see [this similar question](http://stackoverflow.com/questions/1122381/how-to-force-child-div-to-100-of-parents-div-without-specifying-parents-heigh?rq=1) – David Archibald Jan 02 '17 at 22:52

1 Answers1

0

Have you considered an iframe? seems to me you could set the parameters of the iframe inside a table cell, div, as the iframe usually doesn't care where it is on the page.

David Archibald
  • 1,431
  • 14
  • 27
Elq
  • 151
  • 6