Solved

Stop resizing table cell

Posted on 2008-10-22
2
694 Views
Last Modified: 2008-11-09
I have a table cell with 200px height 200px. How can prevent this cell from resizing even if an image with bigger size than the table cell is inserted?  I have only one row and one cell only in the cell.

ayha
0
Comment
Question by:ayha1999
2 Comments
 
LVL 8

Expert Comment

by:ccpjc
ID: 22779271
<td width=200px height=200px>
[img]
</td>
0
 
LVL 8

Accepted Solution

by:
eszaq earned 30 total points
ID: 22780330
ccpjc: you are wrong. Tables do not shrink to the size  of contents if width is specified in html, but they still do stretch if contents does not fit otherwise. Just test your solution to see the result
<table border=2>
<tr><td width=200px height=200px>
<img src="xxx.gif" alt="here" width="500" height="400" border="1">
</td></tr>
</table>

The question is: what needs to be done? Can desired result be achieved by using background-image instead of placing i<mg> inside <td>?
<td background="xxx.gif">your contents</td>
OR maybe resize image forcefully
<td><img src="xxx.gif" alt="here" width="200" height="200" border="1"></td>
OR add style to img tag:
<td><img src="sss.gif" alt="here" width="300" height="500" border="1" style="width:100px;height:100px;"></td>

As you see style value overrides values of HTML attribures img's height and width.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question