how to remove gaps in table cells after change doctype to strict

IF you have sliced your website using photoshop and export as “html with images”.
and then you changed doctype from:
<!DOCTYPE html PUBLIC “-//W3C//DTD html 4.01 Transitional//EN”>
to:
<!DOCTYPE html PUBLIC “-//W3C//DTD html 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>

You will probably see gaps in table cells. These can be removed by two ways.

One way:
remove all the carriage returns and change

<td>
<img src=”abc.jpg” />
</td>

to

<td><img src=”abc.jpg” /></td>

You can add carriage return inside a tag if you realy need it. like

<td
><img src=”abc.jpg” /><
/td>

Another Way:
add css in your page to convert all images in the table cells to block type.

img { display:block; }

Hope this would be helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *


× six = 24