?
Solved

Stop resizing table cell

Posted on 2008-10-22
2
Medium Priority
?
700 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
[X]
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
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 120 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

777 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