The white space is because of the <img>
not the <table>
element. Because of it's display mode it's behaving like text and reserving some space for 'Descenders' which are the low-hanging parts of text for example the bottom part of a lower case 'y'.
For more on a 'descender': Typography Descenders, on Wikipedia
The basic solution:
The solution is to set the CSS style display:block
on your <img>
elements.
The 'elegant' solution:
You can implement a CSS rule to automatically set display:block
on all images who are the only child of a table's <td>
element:
td img:only-child {display:block}
Edit: You can also use the CSS attribute vertical-align
to solve this issue whilst preserving display:inline-block
.
Forked example:
Click here for JSFiddle example