Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Stop resizing table cell

Posted on 2008-10-22
2
695 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

789 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