Make the background color <div> fill in the attached <td>
I have an HTML table whose cells contain a div with display:inline-block containing text of different sizes.
I need text for baseline alignment, and I need div background colors to fill the height of the cells. For the largest font, the background color fills the cell, but not for smaller fonts:

Is it possible? Obvious solutions, such as div { height:100% } , seem to be too different font sizes.
Here is the code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <style type="text/css"> table td { vertical-align: baseline; padding: 0; } td div { display: inline-block; } </style> </head> <body> <table> <tr> <td style="background-color:cyan"> <div style="background-color:pink;">Pink</div> <div style="background-color:green;">Green</div> </td> <td style="background-color:cyan"> <div style='font-size: 40pt; background-color:yellow;'> Big yellow text </div> </td> </tr> </table> </body> </html> It is also located in jsfiddle here .
Quick and dirty fix:
CSS
div { line-height:60px; height:60px; vertical-align:middle; } Not perfect, but the closest I could get:
I read once that td does not report this height. Therefore, any height: 100% or height:auto , etc. Will not work.
So my solution is here: http://jsfiddle.net/UGTYP/
It changes the height of the pink text to the height of the yellow div with javascript.