Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 26th, 2007, 9:30 PM   #11
jasonfrost
Newbie
 
Join Date: Aug 2007
Posts: 16
Rep Power: 0 jasonfrost is on a distinguished road
Re: fitting image into table cell

Quote:
Originally Posted by Sane View Post
Is your question how to make an image automatically resize to take up the remaining space in a table cell, if the size of the cell is unknown?

That would very weird if that's your question: I was just trying to figure that out myself this morning. I don't know if it's possible, although I'd like it to be.

No this is all static.
jasonfrost is offline   Reply With Quote
Old Nov 27th, 2007, 10:41 AM   #12
jasonfrost
Newbie
 
Join Date: Aug 2007
Posts: 16
Rep Power: 0 jasonfrost is on a distinguished road
Re: fitting image into table cell

Here's a little snipit of code:

<table border=1 height=600 cellspacing=20 width=500 style="color:white"valign="center" align="center">
		<tr>
			<td><img height=50 width=50 src="C:\Documents and Settings\Owner\My Documents\My Pictures\me.jpg"></ ></td>
			<td>text</td> 
			<td>text</td>
		</tr>
jasonfrost is offline   Reply With Quote
Old Nov 27th, 2007, 11:25 AM   #13
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: fitting image into table cell

Quote:
it gives you some sort of padding in the cell
<table border=1 height=600 cellspacing=20 width=500 style="color:white"valign="center" align="center">
Inside or outside the border? Cellspacing has a way of doing that. Further, if the text in the adjoining cells causes a height increase, the height of the cell with the photo will increase, also.

I'm guessing that your rendering is pretty much as it should be, given the html you've written, and the content.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 27th, 2007, 11:26 AM   #14
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,787
Rep Power: 5 Sane will become famous soon enough
Re: fitting image into table cell

Maybe it's the cellspacing=20 that's giving you undesirable results. That will form outer padding around the image no matter how large you make it. Try setting that to 0, and pad the other cells with a td class.
Sane is online now   Reply With Quote
Old Nov 27th, 2007, 1:54 PM   #15
jasonfrost
Newbie
 
Join Date: Aug 2007
Posts: 16
Rep Power: 0 jasonfrost is on a distinguished road
Re: fitting image into table cell

Well why would cell spacing give you any trouble? Cell padding would give you the extra space around the image. How could something out side the cell affect something in the cell?

Anyways, I think I have it now. I just specified the cell size and sized the image accordingly. I thought I tried this before but apparently I hadn't, but seems to do what I want.
jasonfrost is offline   Reply With Quote
Old Nov 27th, 2007, 2:02 PM   #16
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: fitting image into table cell

You didn't make it clear where the unwanted space was. That's why I asked if it was inside the border or outside.

Information is key when it comes to getting a problem solved by those who aren't sitting in your chair. You didn't even post any code until post #12. We aren't mind readers.

Let me suggest that you visit the C forum and read the "How to Post a Question" thread.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 27th, 2007, 3:01 PM   #17
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,787
Rep Power: 5 Sane will become famous soon enough
Re: fitting image into table cell

The point is... cellpadding can appear to affect the padding of a cell by shifting its placement with respect to the other cells. As DaWei said, you didn't explain your problem, and that's all we had to go on.
Sane is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing table cell contents using DHTML eyeball_kid JavaScript and Client-Side Browser Scripting 2 Oct 2nd, 2007 12:32 AM
text in a table cell glevine JavaScript and Client-Side Browser Scripting 5 Jun 12th, 2005 8:37 AM
word wrap in a table cell? kerriganm HTML / XHTML / CSS 4 May 6th, 2005 5:38 PM
Checking source codes of image, audio and video files on_auc C++ 3 Feb 21st, 2005 8:36 PM
Change background on a table row (or cell) kurifu Java 2 Jan 11th, 2005 6:38 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:12 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC