|
Posted by David Ross on December 5, 2005, 6:32 pm
Please log in for more thread options
Michael Mayo wrote:
>
> I have a simple html page that contains an image in a single table cell,
> surrounded by a border: <http://www.softrains.com/lc/test.html>. I would
> like to eliminate the space between the table border and the table
> contents. I have tried setting margin: 0 in CSS everywhere, as well as
> cellmargin/cellpadding in HTML.
>
> What is the best way to eliminate the extra space between a table border
> and its contents?
Don't use a table for this. Use a style-sheet or local style to
set the border on the image itself. Center the image using a div
with a centered style:
<div style="text-align:center"><img . . .></div>
(But I would probably use <p align="center">, which is still
tolerated under HTML 4.01 transitional.)
Tables should be used only to present information in a tabular
arrangement.
--
David E. Ross
<URL:http://www.rossde.com/>
I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
|