Connecting Tech Pros Worldwide Forums | Help | Site Map

Prevent an image from overflowing table size

tshad
Guest
 
Posts: n/a
#1: Feb 8 '07
I have a table with an image in it that is larger that the width and height.

<table class="dataTable" width="500px" height="400px" border="0"
cellpadding="0" cellspacing="0">
<tr height="400px" >
<td nowrap style="width:500px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</td>
</tr>
</table>

If the picture is 600 by 500, it goes over the size of the table.

With text, this would force it to wrap.

Isn't the table dimensions supposed to constrain the image and text to that
maximum size?

Thanks,

Tom



bruce barker
Guest
 
Posts: n/a
#2: Feb 8 '07

re: Prevent an image from overflowing table size


width and height are hints. to force absolute sizes you need to use a
style command. also unless you specify an overflow behavior, the image
will still be bigger than the table. you could specify a size of the
image and the browser will scale it.

-- bruce (sqlwork.com)

tshad wrote:
Quote:
I have a table with an image in it that is larger that the width and height.
>
<table class="dataTable" width="500px" height="400px" border="0"
cellpadding="0" cellspacing="0">
<tr height="400px" >
<td nowrap style="width:500px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</td>
</tr>
</table>
>
If the picture is 600 by 500, it goes over the size of the table.
>
With text, this would force it to wrap.
>
Isn't the table dimensions supposed to constrain the image and text to that
maximum size?
>
Thanks,
>
Tom
>
>
tshad
Guest
 
Posts: n/a
#3: Feb 8 '07

re: Prevent an image from overflowing table size


"bruce barker" <nospam@nospam.comwrote in message
news:O5%23Dk77SHHA.4832@TK2MSFTNGP04.phx.gbl...
Quote:
width and height are hints. to force absolute sizes you need to use a
style command. also unless you specify an overflow behavior, the image
will still be bigger than the table. you could specify a size of the image
and the browser will scale it.
How do you do that?

I tried making the changes to styles and I am still getting the same
problem:

<anthem:Panel ID="GeoCodesDiv" Visible="true" style="position:absolute;
top:110px; left:500px; z-index:2000" runat="server">
<table class="dataTable" style="height:400px; width:500px" border="0"
cellpadding="0" cellspacing="0">
<tr style="height:400px">
<td nowrap style="width:500px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</td>
</tr>
</table>
</anthem:Panel>

Tom
Quote:
>
-- bruce (sqlwork.com)
>
tshad wrote:
Quote:
>I have a table with an image in it that is larger that the width and
>height.
>>
> <table class="dataTable" width="500px" height="400px" border="0"
>cellpadding="0" cellspacing="0">
> <tr height="400px" >
> <td nowrap style="width:500px">
> <asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
>runat="server"/>
> </td>
> </tr>
> </table>
>>
>If the picture is 600 by 500, it goes over the size of the table.
>>
>With text, this would force it to wrap.
>>
>Isn't the table dimensions supposed to constrain the image and text to
>that maximum size?
>>
>Thanks,
>>
>Tom

=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
 
Posts: n/a
#4: Feb 8 '07

re: Prevent an image from overflowing table size


<table class="dataTable" style="height:400px; width:500px" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td>
<div style="overflow:hidden;width:500px;height:400px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</div>
</td>
</tr>
</table>

--
Milosz


"tshad" wrote:
Quote:
"bruce barker" <nospam@nospam.comwrote in message
news:O5%23Dk77SHHA.4832@TK2MSFTNGP04.phx.gbl...
Quote:
width and height are hints. to force absolute sizes you need to use a
style command. also unless you specify an overflow behavior, the image
will still be bigger than the table. you could specify a size of the image
and the browser will scale it.
>
How do you do that?
>
I tried making the changes to styles and I am still getting the same
problem:
>
<anthem:Panel ID="GeoCodesDiv" Visible="true" style="position:absolute;
top:110px; left:500px; z-index:2000" runat="server">
<table class="dataTable" style="height:400px; width:500px" border="0"
cellpadding="0" cellspacing="0">
<tr style="height:400px">
<td nowrap style="width:500px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</td>
</tr>
</table>
</anthem:Panel>
>
Tom
Quote:

-- bruce (sqlwork.com)

tshad wrote:
Quote:
I have a table with an image in it that is larger that the width and
height.
>
<table class="dataTable" width="500px" height="400px" border="0"
cellpadding="0" cellspacing="0">
<tr height="400px" >
<td nowrap style="width:500px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</td>
</tr>
</table>
>
If the picture is 600 by 500, it goes over the size of the table.
>
With text, this would force it to wrap.
>
Isn't the table dimensions supposed to constrain the image and text to
that maximum size?
>
Thanks,
>
Tom
>
>
>
tshad
Guest
 
Posts: n/a
#5: Feb 8 '07

re: Prevent an image from overflowing table size


"Milosz Skalecki [MCAD]" <mily242@DONTLIKESPAMwp.plwrote in message
news:9F38AE36-7866-49C6-9795-EC9F47D47F9C@microsoft.com...
Quote:
<table class="dataTable" style="height:400px; width:500px" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td>
<div style="overflow:hidden;width:500px;height:400px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</div>
</td>
</tr>
</table>
That worked great.

Are there any other options I could do with this such that it would resize
if too large but wouldn't stretch it if smaller than the table size.

Thanks,

Tom
Quote:
>
--
Milosz
>
>
"tshad" wrote:
>
Quote:
>"bruce barker" <nospam@nospam.comwrote in message
>news:O5%23Dk77SHHA.4832@TK2MSFTNGP04.phx.gbl...
Quote:
width and height are hints. to force absolute sizes you need to use a
style command. also unless you specify an overflow behavior, the image
will still be bigger than the table. you could specify a size of the
image
and the browser will scale it.
>>
>How do you do that?
>>
>I tried making the changes to styles and I am still getting the same
>problem:
>>
> <anthem:Panel ID="GeoCodesDiv" Visible="true"
>style="position:absolute;
>top:110px; left:500px; z-index:2000" runat="server">
> <table class="dataTable" style="height:400px; width:500px" border="0"
>cellpadding="0" cellspacing="0">
> <tr style="height:400px">
> <td nowrap style="width:500px">
> <asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
>runat="server"/>
> </td>
> </tr>
> </table>
> </anthem:Panel>
>>
>Tom
Quote:
>
-- bruce (sqlwork.com)
>
tshad wrote:
>I have a table with an image in it that is larger that the width and
>height.
>>
> <table class="dataTable" width="500px" height="400px" border="0"
>cellpadding="0" cellspacing="0">
> <tr height="400px" >
> <td nowrap style="width:500px">
> <asp:Image id="CompanyPicture"
>ImageUrl="\uploads\SmartCorner1.jpg"
>runat="server"/>
> </td>
> </tr>
> </table>
>>
>If the picture is 600 by 500, it goes over the size of the table.
>>
>With text, this would force it to wrap.
>>
>Isn't the table dimensions supposed to constrain the image and text to
>that maximum size?
>>
>Thanks,
>>
>Tom
>>
>>
>>

=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
 
Posts: n/a
#6: Feb 9 '07

re: Prevent an image from overflowing table size


Howdy,

Yes, there are. See my replies to topic (it should work for regular
asp:image as well):

http://www.microsoft.com/communities...e-f3c3e2f7a618
--
Milosz


"tshad" wrote:
Quote:
"Milosz Skalecki [MCAD]" <mily242@DONTLIKESPAMwp.plwrote in message
news:9F38AE36-7866-49C6-9795-EC9F47D47F9C@microsoft.com...
Quote:
<table class="dataTable" style="height:400px; width:500px" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td>
<div style="overflow:hidden;width:500px;height:400px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</div>
</td>
</tr>
</table>
>
That worked great.
>
Are there any other options I could do with this such that it would resize
if too large but wouldn't stretch it if smaller than the table size.
>
Thanks,
>
Tom
Quote:

--
Milosz


"tshad" wrote:
Quote:
"bruce barker" <nospam@nospam.comwrote in message
news:O5%23Dk77SHHA.4832@TK2MSFTNGP04.phx.gbl...
width and height are hints. to force absolute sizes you need to use a
style command. also unless you specify an overflow behavior, the image
will still be bigger than the table. you could specify a size of the
image
and the browser will scale it.
>
How do you do that?
>
I tried making the changes to styles and I am still getting the same
problem:
>
<anthem:Panel ID="GeoCodesDiv" Visible="true"
style="position:absolute;
top:110px; left:500px; z-index:2000" runat="server">
<table class="dataTable" style="height:400px; width:500px" border="0"
cellpadding="0" cellspacing="0">
<tr style="height:400px">
<td nowrap style="width:500px">
<asp:Image id="CompanyPicture" ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</td>
</tr>
</table>
</anthem:Panel>
>
Tom

-- bruce (sqlwork.com)

tshad wrote:
I have a table with an image in it that is larger that the width and
height.
>
<table class="dataTable" width="500px" height="400px" border="0"
cellpadding="0" cellspacing="0">
<tr height="400px" >
<td nowrap style="width:500px">
<asp:Image id="CompanyPicture"
ImageUrl="\uploads\SmartCorner1.jpg"
runat="server"/>
</td>
</tr>
</table>
>
If the picture is 600 by 500, it goes over the size of the table.
>
With text, this would force it to wrap.
>
Isn't the table dimensions supposed to constrain the image and text to
that maximum size?
>
Thanks,
>
Tom
>
>
>
>
>
>
Closed Thread