Alex Mueller on Software and Technology 
Thursday, January 27, 2005

I was working on a new site today and I came across a situation with HTML images that perplexed me. While in the process of skinning this site, I was creating gifs for my header, one pixel at a time it seemed. To make a long story short, the following HTML code will help demonstrate the issue.

For any given HTML table and an HTML image, I was using something like this.
<table cellspacing=”0” cellpadding=”0” border=”0” width=”100%”>
   <tr>
      <td align=”center”>
         <img src=”someimage.gif” border=”0”/>
      </td>
   </tr>
</table>

Notice the extra pixels here.

Even if you do not have a proper image my test will still work. What happens is below the image, there appears to be about 2-3 pixels of empty space. What I was doing required that my tables be seamless. It turns out, if I set the background attribute of the “TD” tag, it resolves my problem, but that does not answer my question.

<table cellspacing=”0” cellpadding=”0” border=”0” width="100%">
   <tr>
      <td align="center" background="someimage.gif">
      </td>
   </tr>
</table>

I tried a number of different scenarios, but nothing removed that pesky white space. I could not find any help searching the internet for answers. I guess we just have to live with the extra pixels. In the meantime, I’ll stick to my background attribute.

Thursday, January 27, 2005 7:40:16 PM (Mountain Standard Time, UTC-07:00) | Comments [0] | #
MuellerDesigns.net
Search
On This Page
The Split Personality of the Tester/Developer
Cross Site Scripting (XSS)
Creating files with FSUTIL
PowerShell Management Library for Hyper-V
Installing Windows 7
Installing Linux in Hyper-V
Internet Explorer 8 Release Candidate 1
PowerShell Documentation
Automate Daily Tasks with PowerShell
SketchPath XPath Editor
Software Testing - Revisited
Architecting Buildings and Software
NBCOlympics.com with Silverlight
Marker Interfaces and C# Attributes
Most Popular
JavaScript ReplaceAll Functionality
What is polymorphism?
What is composition?
Sorting with IComparable and IComparer
Applying the Observer Pattern in ASP.NET
MVP in ASP.NET
What is abstraction?
What is encapsulation?
What is a class?
What is inheritance?
Authentication in ASP.NET
Calendar Controls
XPathNavigator.CheckValidity new for 2.0
SQL Server 2005 Connection Issues
Auto-attach to process '[####] aspnet_wp.exe' on m...
What is an object?
FreeTextBox
VMWare and VPC
An Example of Reflection using C#
Changing File Ownership In Vista and Longhorn
Archive
Links
Categories
My Local Blog Map
Blogroll
About
Powered by:

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
MuellerDesigns.net

Sign In

Help Those In Need
The Hunger Site
Ronald McDonald House Charities (RMHC) of Western Washington & Alaska