Click here to get back home

How to eliminate space between table border and table contents?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
How to eliminate space between table border and table contents? Michael Mayo 12-06-2005
Get Chitika Premium
Posted by Adam Risser on December 6, 2005, 7:12 am
Please log in for more thread options


Why not eliminate the table and just add

style="border: solid #41A0D0 2px;"

to the image itself? Is that not what you want?


Posted by none on December 6, 2005, 11:11 am
Please log in for more thread options


On Tue, 06 Dec 2005 07:12:10 -0800, Adam Risser wrote:
> Why not eliminate the table and just add
> style="border: solid #41A0D0 2px;"
> to the image itself? Is that not what you want?

The page I presented is a bit oversimplified. In the final version, the
image will be at the top of a table containing the entire page, with a
border drawn around the entire page. So, I don't think this will work.

Thanks,
-Mike

Posted by Lauri Raittila on December 6, 2005, 5:52 pm
Please log in for more thread options


in comp.infosystems.www.authoring.html, none wrote:
> On Tue, 06 Dec 2005 07:12:10 -0800, Adam Risser wrote:
> > Why not eliminate the table and just add
> > style="border: solid #41A0D0 2px;"
> > to the image itself? Is that not what you want?
>
> The page I presented is a bit oversimplified. In the final version, the
> image will be at the top of a table containing the entire page, with a
> border drawn around the entire page. So, I don't think this will work.

Then something else will work. Wrapping anything to a table just to get a
border is a stupid idea, because it doesn't work on any browser, let
alone work similarly. And understanding how it should work, and how it
works in different browsers is not exactly simple. And it is not even
correct...

Wrap things to div instead, and give div a border. (and never wrap just
one element in something to get border, unless you need multible
borders/backgrounds/whatever)

Far more easy to get right. Unless you really need to get it work pixel
perfectly on NN3 or IE3, but then, why would you even consider CSS?

Anyway, if you happened to have image in table, and you would need to get
rid of that space, you could do some or all off:

table /* thakes away spacing between cells in
separated borderr modell*/
table /* changes border modell*/
img /* aligns image to top of line*/
img /* changes image to block thus it is not rendered
on baseline*/




--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>

Posted by none on December 6, 2005, 7:57 pm
Please log in for more thread options


On Tue, 06 Dec 2005 17:52:54 +0100, Lauri Raittila wrote:
> Then something else will work. Wrapping anything to a table just to get a
> border is a stupid idea, because it doesn't work on any browser,

What do you mean by 'doesn't work'? I agree that it isn't the right way to
do it, but I'm hoping that it will work anyway in most cases.


> Wrap things to div instead, and give div a border. (and never wrap just
> one element in something to get border, unless you need multible
> borders/backgrounds/whatever)

As I mentioned previously, I can't use the div tag anywhere in my html for
political reasons -- it has been officially declared an enemy of the
revolution.


> img
> /* aligns image to top of line*/ img
> /* changes image to block thus it is not rendered on baseline*/

Hrm...aren't vertical-align:top and display:block the default for images?

Thanks,
-Mike

Posted by Steve Pugh on December 7, 2005, 6:14 am
Please log in for more thread options


none wrote:
> On Tue, 06 Dec 2005 17:52:54 +0100, Lauri Raittila wrote:

> > img
> > /* aligns image to top of line*/ img
> > /* changes image to block thus it is not rendered on baseline*/
>
> Hrm...aren't vertical-align:top and display:block the default for images?

No. vertical-align: baseline and display: inline would be much closer
to the default presentation of <img> elements in most browsers.

Steve


Similar ThreadsPosted
Fixing a Table of Contents Menu, when contents Scroll May 5, 2008, 7:40 am
Multiple-level Table of Contents April 6, 2006, 9:59 am
table/cell contents postioning question? September 3, 2005, 10:27 am
Vertical alignment of table cell contents in FireFox August 27, 2006, 5:55 am
Table border (outside only) August 6, 2004, 8:16 am
table cell border and css February 4, 2005, 10:32 pm
Table border & backgroundcolor May 11, 2005, 4:51 pm
Bottom border on after the headings on the table.. November 19, 2004, 2:23 am
Why Blank Space on Last Row of Table? July 29, 2004, 3:00 am
Div in Table Cell extra space July 29, 2004, 2:26 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap