Solved

Stop resizing table cell

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now