| Coding Forum Problems with your code? Let's hear about it. |
|
View Poll Results: Who Will Get The Solution First?
|
|
Ricoool
|
 
|
0 |
0% |
|
Jazzee
|
 
|
3 |
50.00% |
|
Pimpen 2010
|
 
|
0 |
0% |
|
Fusion
|
 
|
1 |
16.67% |
|
LazyJim
|
 
|
0 |
0% |
|
littleFella
|
 
|
0 |
0% |
|
Someone Else
|
 
|
2 |
33.33% |
09-25-2004, 08:08 PM
|
#1 (permalink)
|
|
Inactive
Join Date: 05-12-04
Posts: 520
Latest Blog: None
|
Who Will Get The Solution First?
A table is created that has 1 col with 5 rows. Each cell contains a form that has graphic image to click on. The grapic is the only part of the form that is visible. The graphic image is 36px tall and 116px wide. The table is 200px wide and the images are centered in the table cells. The table has cellpadding, cellspacing, and border set to "0". The cells of the table have the height set to the height of the graphic. The height of the cells does not shrink to the size of the graphic. How do you get the cell height to shrink to the size of the graphic? What is the code that needs to be used to make the cell height the same as the image.
Last edited by seonewbee : 09-25-2004 at 08:15 PM.
|
|
|
09-25-2004, 08:10 PM
|
#2 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
What?
Edit: Nvm, when I posted this, your post was empty and there was no poll 
|
|
|
09-25-2004, 08:20 PM
|
#3 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
I think if you have <form> inside a table cell, you get extra padding no matter what.
|
|
|
09-25-2004, 08:21 PM
|
#4 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
I usually get around that by putting the <form> tags outside of the table, but that won't work if you have multiple forms in the same table.
|
|
|
09-25-2004, 08:21 PM
|
#5 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
So... I guess I don't have an answer for ya 
|
|
|
09-25-2004, 08:30 PM
|
#6 (permalink)
|
|
Inactive
Join Date: 05-12-04
Posts: 520
Latest Blog: None
|
Quote:
|
Originally Posted by Jazzee
What?
Edit: Nvm, when I posted this, your post was empty and there was no poll 
|
Yes, you are right. The stupid program makes you put in a message before creating the poll. I figured that you might be the first so, I put the question in last - the edit. Just the way the program makes you do things. Have a nice weekend. I have got to go because of the hurricane. My third this year. Hate hurricanes. Lost power for 4 days last time. Not very fun.
|
|
|
09-25-2004, 09:42 PM
|
#7 (permalink)
|
|
v7n Mentor
Join Date: 02-18-04
Location: Minneapolis, Minnesota
Posts: 1,941
|
You could use javascript to get around this. Something like this. The following code is not 100% complete but enough to get the point accross. As Jazzee said adding a form in a table will add extra padding. But there are creative ways around that.
---------------------------------------------------------------
<form name="form1" action="page1.htm"><input type='hidden' name='1'></form>
<form name="form2" action="page2.htm"><input type='hidden' name='2'></form>
<form name="form3" action="page2.htm"><input type='hidden' name='3'></form>
<form name="form4" action="page2.htm"><input type='hidden' name='4'></form>
<form name="form5" action="page2.htm"><input type='hidden' name='5'></form>
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="javascript: document.form1.submit();"><img src="image.jpg" width="11" height="36"></a></td>
<td><a href="javascript: document.form2.submit();"><img src="image.jpg" width="11" height="36"></a></td>
<td><a href="javascript: document.form3.submit();"><img src="image.jpg" width="11" height="36"></a></td>
<td><a href="javascript: document.form4.submit();"><img src="image.jpg" width="11" height="36"></a></td>
<td><a href="javascript: document.form5.submit();"><img src="image.jpg" width="11" height="36"></a></td>
</tr>
</table>
---------------------------------------------------------------
imaginemn
|
|
|
09-25-2004, 09:45 PM
|
#8 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
Very tricky. Nice 
|
|
|
09-28-2004, 04:32 PM
|
#9 (permalink)
|
|
Inactive
Join Date: 10-13-03
Location: New Zealand
Posts: 534
Latest Blog: None
|
I have actually used CSS on forms to get rid of the padding. I don't think it's strictly legal but much to my surprise it does work.
|
|
|
09-29-2004, 06:15 AM
|
#10 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
Just what I was going to say Dave, CSS the extra padding/margins away. In addition you may find the you need to remove any new-line , tabs and spaces from the HTML code with-in each <td>.
|
|
|
09-29-2004, 06:17 AM
|
#11 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
You could make all sorts of scripts like imaginemn's but depending on what you're actually doing you might not even need to put forms or javascript in there at all
|
|
|
09-29-2004, 06:17 AM
|
#12 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
p.s. I voted for "someone else" 
|
|
|
09-29-2004, 08:52 AM
|
#13 (permalink)
|
|
Inactive
Join Date: 03-08-04
Posts: 2,644
Latest Blog: None
|
I can get it to work in Firefox.
|
|
|
09-29-2004, 08:56 AM
|
#14 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
Quote:
|
Originally Posted by LazyJim
Just what I was going to say Dave, CSS the extra padding/margins away. In addition you may find the you need to remove any new-line , tabs and spaces from the HTML code with-in each <td>.
|
Two questions:
1. How would you do this with CSS padding and/or margins? Put it on the <form>?
2. I have noticed that sometimes new lines and stuff in the html cause spaces or gaps on the page. Do you know why it does this and why it only happens sometimes?
|
|
|
09-29-2004, 09:00 AM
|
#15 (permalink)
|
|
Inactive
Join Date: 03-08-04
Posts: 2,644
Latest Blog: None
|
Quote:
|
Originally Posted by LazyJim
Just what I was going to say Dave, CSS the extra padding/margins away. In addition you may find the you need to remove any new-line , tabs and spaces from the HTML code with-in each <td>.
|
how does removing lines work?

|
|
|
09-29-2004, 09:01 AM
|
#16 (permalink)
|
|
Inactive
Join Date: 03-08-04
Posts: 2,644
Latest Blog: None
|
Quote:
|
Originally Posted by Jazzee
Two questions:
1. How would you do this with CSS padding and/or margins? Put it on the <form>?
2. I have noticed that sometimes new lines and stuff in the html cause spaces or gaps on the page. Do you know why it does this and why it only happens sometimes?
|
1. Put the css in the Form name.
2. Is this just IE?
|
|
|
09-29-2004, 09:13 AM
|
#17 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
2. I test in a few browsers. I don't remember if this only happens in IE or not.
|
|
|
09-29-2004, 09:19 AM
|
#18 (permalink)
|
|
Inactive
Join Date: 03-08-04
Posts: 2,644
Latest Blog: None
|
It is only IE. I had problems with forms on templates in IE. There is a way around by putting the Form outside I think. Hmm on this problem maybe use nested tables, to get around the IE problem. That might work then you just have to mess around with that IE hack thing on each table. Cus you cant do it on one table with multiple forms.
|
|
|
09-29-2004, 03:14 PM
|
#19 (permalink)
|
|
Inactive
Join Date: 10-13-03
Location: New Zealand
Posts: 534
Latest Blog: None
|
In my experience the css solution works in both IE and Mozilla. The unwanted padding doesn't actually seem to be a problem in Mozilla though.
HTML Code:
<form style="margin:0px;padding:0px;">
Try it with 10px padding and you'll see Mozilla and IE behave pretty much the same.
|
|
|
09-29-2004, 03:29 PM
|
#20 (permalink)
|
|
Inactive
Join Date: 05-12-04
Posts: 520
Latest Blog: None
|
imaginemn, Thank you for the code, I shall see how it works. Much rather prefer something that is not client side scripting, but I guess everybody has scripting and javascript turned on. Thanks for taking the time to code me a solution.
Dave, interesting code. I shall try it also. Thanks.
Have a nice day all.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
| |