Sunday, March 05, 2017

[rifctyln] Table of images

<table cellspacing="0" cellpadding="0"> <tr> <td> <img style="display:block" ... /> </td> ... </tr> ... </table>

Note that making img a block element means it'll add a newline like a paragraph, so no more than one image (horizontally) per TD.

Previously demonstrated here.

Interestingly, before CSS, HTML tables were the way to do precise layout; nowadays due to newer default DOCTYPE's, CSS is ironically required to do it this old-school way.

cellspacing and cellpadding go away in HTML5, so CSS "border-spacing" needs to be applied to the table and "padding" to each(!) TD.

No comments :