# html tables in Internet Explorer [Moved from IE]



## rogdawg (Dec 12, 2005)

I am trying to create a 2-column html table. I want to put a large image in a cell within the second column of the table, and "wrap" the image in <div> tags so I can limit the display width, and have scroll bars so the user can scroll the image to view the entire thing. 

The sizing of the <div> works correctly but, the table is always the width of the ENTIRE image...nothing I do seems to limit the width of the table. So, even though the <div> is the correct width, and has the scroll bars, the table is the width of the underlying image.

I will include some sample text to demonstrate the problem. Just choose a large image that you might have on your machine, and insert it's path into the <img> tag. The example image I am using is 1600X1200. 

PS: in this example I am using "min-width" and "max-width", but the problem is the same if I simply use "width".

This code works properly in Firefox. Is there anything I can do to get the desired behavior in IE or, are table widths determined by the contents of the table in IE, regardless of the properties that are defined?

Thanks, in advance, for any advice you can give.


```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test a Large Image in a Table</title>
</head>

<body>
<table style="border-bottom-width:thin; width:60em;">
	<tr>
		<td style="width=20%; background-color:gray;">
			Title #1	
		</td>
		<td style="width=80%; background-color:red;">
			Why is the table width the same as the width of the image below, in IE?
		</td>
	</tr>
	<tr>
		<td style="width=20%; background-color:gray;">
			Title #2
		</td>
		<td style="width=80%; background-color:red;">
			<div style="overflow:auto; min-width:30em; max-width:50em;">
				<img src="" alt="some large image" />
			</div>
		</td>
	</tr>
</table>
</body>
</html>
```


----------



## bingbang (Feb 4, 2008)

*Re: html tables in Internet Explorer*

Hi
My web programming skills aren't really good enough to help you but i have a few suggestions.

Don't use tables and position everything using css
Its actually very easy to learn i used a tutorial at the website html-dog (google for it) which was very helpful.
Tables should only really be used for tabular data and are not a way to lay out websites.

I think it will look awful if you have to scroll to see the rest of the picture in the way that you describe, if you have to put it in a table why not put a thumbnail in which when clicked links to the full size version of the picture?


----------



## rogdawg (Dec 12, 2005)

*Re: html tables in Internet Explorer*

thanks for your response.

I agree with you that tables should be avoided. But, the current design uses tables (this is an ASP web application) and changing all of that is beyond the scope of my current project. Plus, this is actually tabular data, so using tables, at least for the moment, makes some sense. Also, these aren't really images I am dealing with, they are org charts and flow charts that are generated by a 3rd party control I am using. But, for the sake of demonstrating the problem, images work. 

Again, thanks for your response. If I can solve this "simple" problem, I will have some really nice functionality going.


----------

