Responsive row of images and text

css, html, image, responsive-design

Solution

add the following to the table css:

table-layout: fixed;

In your case:

table {
    width: 80%;
    table-layout: fixed;
}

updated jsfiddle here - http://jsfiddle.net/Y7CrV/7/

Problem

I've lined up five images on a row with text below each one and I'm trying to make it responsive. The problem is that all the images don't scale down properly. I want them all to have the same width & height. My code so far: ``` <table> <tr> <td> <img src="http://thumbs.dreamstime.com/thumb160_268/1210514734LWUcju.jpg" /> <p>testing text</p> </td> <td> <img src="http://thumbs.dreamstime.com/thumb160_268/1210514734LWUcju.jpg" /> <p>Longerishhh texting text</p> </td> <td> <img src="http://thumbs.dreamstime.com/thumb160_268/1210514734LWUcju.jpg" /> <p>Text</p> </td> <td> <img src="http://thumbs.dreamstime.com/thumb160_268/1210514734LWUcju.jpg" /> <p>Quite long text</p> </td> <td> <img src="http://thumbs.dreamstime.com/thumb160_268/1210514734LWUcju.jpg" /> <p>More testing</p> </td> </tr> </table> ``` CSS: ``` html{ width: 100%; } table{ width: 80%; } td{ display: table-cell; width: 20%; text-align: center; overflow: hidden; vertical-align: baseline; } img{ width: 100%; } ``` jsfiddle

Original source