Is Table Width Required for Table that Holds Image?

  • Thread starter Thread starter Earl Teigrob
  • Start date Start date
E

Earl Teigrob

I am dynamically generating pages from images on the server and place each
image into a single cell table (which I use to create a border around the
image)
The problem is that if I do not specify a table width, sometimes the table
will collapse over image, cutting off the right side of the image. This
means that for each image I need to instance an "Image" class and read its
width property, which is a huge preformance killer. Has anyone else
encountered this issue that has found a solution that does not require
setting the table width...

Thanks

Earl
 
Hi,
you don't really need a table just to add a border, you can do
<style type="text/css">
img{
border: 2px solid black;
}
</style>
will give all your images a 2 pixel black border

Jon
 
Earl Teigrobwrote:
I am dynamically generating pages from images on the server and place
each
image into a single cell table (which I use to create a border around the
image)
The problem is that if I do not specify a table width, sometimes the table
will collapse over image, cutting off the right side of the image. This
means that for each image I need to instance an "Image" class and read its
width property, which is a huge preformance killer. Has anyone else
encountered this issue that has found a solution that does not require
setting the table width...

Thanks

Earl

Your are using server controls for the image?

if so, you can set the border properties of the image on the server
control directly. you don't need to use a table to set the border.
 
Back
Top