Is Table Width Required for Table that Holds Image?

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
 
J

Jon

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
 
S

Shintaro

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top