473,394 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do you reduce table rows height with forms and images?

I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.

Thank you

John
Jul 20 '05 #1
10 7822
Els
John wrote:
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.


Have you tried <img src="img.jpg" style="display:block;"> ?
That might get rid of the space underneath the image, don't
know why you have space above it. Do you have a url?

--
Els

Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -

Jul 20 '05 #2
Els
John wrote:
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.


Have you tried <img src="img.jpg" style="display:block;"> ?
That might get rid of the space underneath the image, don't
know why you have space above it. Do you have a url?

--
Els

Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -

Jul 20 '05 #3
DU
John wrote:
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.

Thank you

John


I never have that sort of problem you describe because I do not resort
to table-design to begin with. Maybe the real issue with your webpage
difficulty is table design...

DU
Jul 20 '05 #4
DU
John wrote:
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.

Thank you

John


I never have that sort of problem you describe because I do not resort
to table-design to begin with. Maybe the real issue with your webpage
difficulty is table design...

DU
Jul 20 '05 #5
"John" <jo******@fastermail.com> a écrit dans le message de
news:1a**************************@posting.google.c om
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.


Almost every time, this is due to nice indent of the HTML code. Exemple :

<td>
<img src=...>
</td>

will produce extra space, although :

<td><img src=...></td>

will not.

But maybe you should show your code in order for us to help you :)

Jul 20 '05 #6
"John" <jo******@fastermail.com> a écrit dans le message de
news:1a**************************@posting.google.c om
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.


Almost every time, this is due to nice indent of the HTML code. Exemple :

<td>
<img src=...>
</td>

will produce extra space, although :

<td><img src=...></td>

will not.

But maybe you should show your code in order for us to help you :)

Jul 20 '05 #7
"Pierre Goiffon" <pg******@nowhere.invalid> wrote in message news:<40***********************@news.free.fr>...
"John" <jo******@fastermail.com> a écrit dans le message de
news:1a**************************@posting.google.c om
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.
Almost every time, this is due to nice indent of the HTML code. Exemple :

<td>
<img src=...>
</td>

will produce extra space, although :

<td><img src=...></td>

will not.

But maybe you should show your code in order for us to help you :)

Here is the code. There are spaces in Explorer but not in FrontPage.

<table cellpadding="0" cellspacing="0" >
<tr><td>
<div onMouseOver="showLayer4('searchforlayer');"
style="width:120; height:0; position:relative;">
<img src=graphics/choicebox120.jpg
style="position:absolute; left:0; top:0; z-index:-99;" alt=""
width=120>
<table ><td>
<center><font color=white>Search
From</font></center>
</td></table></div>
</td>
</tr>
<tr>
<td height=0 valign=top>
<div style="width:150px; Z-INDEX:5; height:0px;
position:relative;">
<DIV align=left id=searchforlayer
style="Z-INDEX:5; display:none; WIDTH:150px; POSITION: absolute;
LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT: blue 1px solid;
BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px solid;
BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<a href=# onclick="searchAll();">ALL</a><br>
<a href=# onclick="searchName();">Product
Name</a><br>
<a href=# onclick="searchSku();">Product
SKU</a><br>
</div</div>
</td>
</tr>
</table>
</td>
<td align=left valign=bottom>
<table cellpadding=0 cellspacing=0 >
<td>Show &nbsp; </td>
<td>
<table cellpadding="0" cellspacing="0" >
<tr><td>
<div
onMouseOver="showLayer4('itemsperpagelayer');" style="width:60;
height:0; position:relative;">
<img src=graphics/choicebox60.jpg
style="position:absolute; left:0; top:0; z-index:-99;" alt=""
width=60>
<table >
<td>
<center><font
color=white>20</font></center>
</td>
</table>
</div>
</td>
</tr>
<tr>
<td height=0 valign=top>
<div style="width:50px; Z-INDEX:5;
height:0px; position:relative;">
<DIV align=left id=itemsperpagelayer
style="Z-INDEX:5; display:none; WIDTH:50px;
POSITION: absolute; LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT:
blue 1px solid; BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px
solid; BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<a href=products.php?showperpage=8>8</a><br>
<a
href=products.php?showperpage=12>12</a><br>
<a
href=products.php?showperpage=16>16</a><br>
</div</div>
</td>
</tr>
</table>
</td><td>&nbsp; per page </td>
</table>
</td></tr>
</table>
<table width=100% cellpadding=0 cellspacing=0 ><tr><td
colspan=4><hr></td></tr>
<tr>
<td colspan=4>
<table cellpadding=0 cellspacing=0 width=100%><td
align=center>
<b> Sort By:</b>&nbsp;</td><td><table>
<tr><td>
<div onMouseOver="showLayer4('catalogCategoryLayer');"
style="width:100; height:0; position:relative;">
<img src=graphics/choicebox100.jpg
style="position:absolute; left:0; top:0; z-index:-99;" alt=""
width=100>
<table><td>
<center><font color=white>Catalogs</font></center>
</td></table></div>
</td>
</tr>
<tr>
<td height=0 valign=top>
<div style="width:150px; Z-INDEX:5; height:0px;
position:relative;">
<DIV align=left id=catalogCategoryLayer
style="Z-INDEX:5; display:none; WIDTH:150px;
POSITION: absolute; LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT:
blue 1px solid; BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px
solid; BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<A
href=products.php?sortby=catalog&manuid=1&category =0>Amazon </A><br>
<A
href=products.php?sortby=catalog&manuid=2&category =0>Barnes and Noble
</A><br>
<A
href=products.php?sortby=catalog&manuid=3&category =0>Borders </A><br>
</div</div>
</td>
</tr>
</table></td> <td><table cellpadding=0 cellspacing=0 <tr><td>
<div onMouseOver="showLayer4('pricerangelayer');"
style="width:120; height:0; position:relative;">
<img src=graphics/choicebox120.jpg style="position:absolute; left:0;
top:0; z-index:-99;" alt="" width=120>
<table ><td>
<center><font color=white>Price Range</font></center>
</td></table></div>
</td>
</tr>

<tr>
<td height=0 valign=top>
<div style="width:150px; Z-INDEX:5; height:0px;
position:relative;">
<DIV align=left id=pricerangelayer
style="Z-INDEX:5; display:none; WIDTH:150px;
POSITION: absolute; LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT:
blue 1px solid; BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px
solid; BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<a href=products.php?sortby=pricerange&pricerange=000 00005>$0-$5</a><br>
<a href=products.php?sortby=pricerange&pricerange=000 60010>$6-$10</a><br>
<a href=products.php?sortby=pricerange&pricerange=001 10020>$11-$20</a><br>
</div</div>
</td>
</tr>
</table> </td><td><table cellpadding=0 cellspacing=0

<tr><td>
<div onMouseOver="showLayer4('selecttypeLayer');"
style="width:120; height:0; position:relative;">
<img src=graphics/choicebox120.jpg style="position:absolute; left:0;
top:0; z-index:-99;" alt="" width=120>
<table ><td>
<center><font color=white>Select Type</font></center>
</td></table></div>
</td>
</tr>
<tr>
<td height=0 valign=top>
<div style="width:150px; Z-INDEX:5; height:0px;
position:relative;">
<DIV align=left id=selecttypeLayer
style="Z-INDEX:5; display:none; WIDTH:150px;
POSITION: absolute; LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT:
blue 1px solid; BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px
solid; BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<a href=products.php?varioustypes=discount&sortby=var ious>Discount</a><br>
<a href=products.php?varioustypes=newest&sortby=vario us>Newest</a><br>
<a href=products.php?varioustypes=topseller&sortby=va rious>Top
Seller</a><br>
</div</div>
</td>
</tr>
</table>


John
Jul 20 '05 #8
"Pierre Goiffon" <pg******@nowhere.invalid> wrote in message news:<40***********************@news.free.fr>...
"John" <jo******@fastermail.com> a écrit dans le message de
news:1a**************************@posting.google.c om
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0 and
cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom of
the picture and image. I need to make the height of the rows to be the
same as the textbox and image. How do I do this? I have tried even
setting the height of the table and all the <td> and <tr> tags to 1
but have not been succesful.
Almost every time, this is due to nice indent of the HTML code. Exemple :

<td>
<img src=...>
</td>

will produce extra space, although :

<td><img src=...></td>

will not.

But maybe you should show your code in order for us to help you :)

Here is the code. There are spaces in Explorer but not in FrontPage.

<table cellpadding="0" cellspacing="0" >
<tr><td>
<div onMouseOver="showLayer4('searchforlayer');"
style="width:120; height:0; position:relative;">
<img src=graphics/choicebox120.jpg
style="position:absolute; left:0; top:0; z-index:-99;" alt=""
width=120>
<table ><td>
<center><font color=white>Search
From</font></center>
</td></table></div>
</td>
</tr>
<tr>
<td height=0 valign=top>
<div style="width:150px; Z-INDEX:5; height:0px;
position:relative;">
<DIV align=left id=searchforlayer
style="Z-INDEX:5; display:none; WIDTH:150px; POSITION: absolute;
LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT: blue 1px solid;
BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px solid;
BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<a href=# onclick="searchAll();">ALL</a><br>
<a href=# onclick="searchName();">Product
Name</a><br>
<a href=# onclick="searchSku();">Product
SKU</a><br>
</div</div>
</td>
</tr>
</table>
</td>
<td align=left valign=bottom>
<table cellpadding=0 cellspacing=0 >
<td>Show &nbsp; </td>
<td>
<table cellpadding="0" cellspacing="0" >
<tr><td>
<div
onMouseOver="showLayer4('itemsperpagelayer');" style="width:60;
height:0; position:relative;">
<img src=graphics/choicebox60.jpg
style="position:absolute; left:0; top:0; z-index:-99;" alt=""
width=60>
<table >
<td>
<center><font
color=white>20</font></center>
</td>
</table>
</div>
</td>
</tr>
<tr>
<td height=0 valign=top>
<div style="width:50px; Z-INDEX:5;
height:0px; position:relative;">
<DIV align=left id=itemsperpagelayer
style="Z-INDEX:5; display:none; WIDTH:50px;
POSITION: absolute; LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT:
blue 1px solid; BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px
solid; BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<a href=products.php?showperpage=8>8</a><br>
<a
href=products.php?showperpage=12>12</a><br>
<a
href=products.php?showperpage=16>16</a><br>
</div</div>
</td>
</tr>
</table>
</td><td>&nbsp; per page </td>
</table>
</td></tr>
</table>
<table width=100% cellpadding=0 cellspacing=0 ><tr><td
colspan=4><hr></td></tr>
<tr>
<td colspan=4>
<table cellpadding=0 cellspacing=0 width=100%><td
align=center>
<b> Sort By:</b>&nbsp;</td><td><table>
<tr><td>
<div onMouseOver="showLayer4('catalogCategoryLayer');"
style="width:100; height:0; position:relative;">
<img src=graphics/choicebox100.jpg
style="position:absolute; left:0; top:0; z-index:-99;" alt=""
width=100>
<table><td>
<center><font color=white>Catalogs</font></center>
</td></table></div>
</td>
</tr>
<tr>
<td height=0 valign=top>
<div style="width:150px; Z-INDEX:5; height:0px;
position:relative;">
<DIV align=left id=catalogCategoryLayer
style="Z-INDEX:5; display:none; WIDTH:150px;
POSITION: absolute; LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT:
blue 1px solid; BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px
solid; BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<A
href=products.php?sortby=catalog&manuid=1&category =0>Amazon </A><br>
<A
href=products.php?sortby=catalog&manuid=2&category =0>Barnes and Noble
</A><br>
<A
href=products.php?sortby=catalog&manuid=3&category =0>Borders </A><br>
</div</div>
</td>
</tr>
</table></td> <td><table cellpadding=0 cellspacing=0 <tr><td>
<div onMouseOver="showLayer4('pricerangelayer');"
style="width:120; height:0; position:relative;">
<img src=graphics/choicebox120.jpg style="position:absolute; left:0;
top:0; z-index:-99;" alt="" width=120>
<table ><td>
<center><font color=white>Price Range</font></center>
</td></table></div>
</td>
</tr>

<tr>
<td height=0 valign=top>
<div style="width:150px; Z-INDEX:5; height:0px;
position:relative;">
<DIV align=left id=pricerangelayer
style="Z-INDEX:5; display:none; WIDTH:150px;
POSITION: absolute; LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT:
blue 1px solid; BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px
solid; BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<a href=products.php?sortby=pricerange&pricerange=000 00005>$0-$5</a><br>
<a href=products.php?sortby=pricerange&pricerange=000 60010>$6-$10</a><br>
<a href=products.php?sortby=pricerange&pricerange=001 10020>$11-$20</a><br>
</div</div>
</td>
</tr>
</table> </td><td><table cellpadding=0 cellspacing=0

<tr><td>
<div onMouseOver="showLayer4('selecttypeLayer');"
style="width:120; height:0; position:relative;">
<img src=graphics/choicebox120.jpg style="position:absolute; left:0;
top:0; z-index:-99;" alt="" width=120>
<table ><td>
<center><font color=white>Select Type</font></center>
</td></table></div>
</td>
</tr>
<tr>
<td height=0 valign=top>
<div style="width:150px; Z-INDEX:5; height:0px;
position:relative;">
<DIV align=left id=selecttypeLayer
style="Z-INDEX:5; display:none; WIDTH:150px;
POSITION: absolute; LEFT: 0px; TOP: 0px; HEIGHT: 0px; BORDER-LEFT:
blue 1px solid; BORDER-BOTTOM: blue 1px solid; BORDER-TOP: blue 1px
solid; BORDER-RIGHT: blue 1px solid; BACKGROUND-COLOR: #FFFFFF;
layer-background-color: #FFFFFF">
<a href=products.php?varioustypes=discount&sortby=var ious>Discount</a><br>
<a href=products.php?varioustypes=newest&sortby=vario us>Newest</a><br>
<a href=products.php?varioustypes=topseller&sortby=va rious>Top
Seller</a><br>
</div</div>
</td>
</tr>
</table>


John
Jul 20 '05 #9
"John" <jo******@fastermail.com> a écrit dans le message de
news:1a**************************@posting.google.c om
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0
and cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom
of the picture and image.
Almost every time, this is due to nice indent of the HTML code.
Here is the code.

(...)

Hu, I think this code would be far much light with a good use of CSS
But that's not the point. Can you try to remove indent and get <td>, </td>
etc close to their contents ?

Jul 20 '05 #10
"John" <jo******@fastermail.com> a écrit dans le message de
news:1a**************************@posting.google.c om
I have a table with two rows. On the first row is a text box and in
the second row is an image. I have set the table cellpadding to 0
and cellspacing to 0.
The table is leaving extra spaces in the rows on the top and bottom
of the picture and image.
Almost every time, this is due to nice indent of the HTML code.
Here is the code.

(...)

Hu, I think this code would be far much light with a good use of CSS
But that's not the point. Can you try to remove indent and get <td>, </td>
etc close to their contents ?

Jul 20 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
0
by: yurps | last post by:
Hello here is my html, if you click the missing image in the first column on the left, the div is shown, when clicked again the div disappears...but the bottom border disappears as well...Is there...
19
by: Craig | last post by:
I have a 3rd party product that is quite old. It produces reports dynamically via the web. It users templates to do this. They are very basic, one looks like this. <html> <head>
11
by: Norman L. DeForest | last post by:
Am I misunderstanding the CSS specifications or is Firefox (version 1.0.6) (and Opera) doing the wrong thing? It appears that Firefox 1.0.6 includes the border in width calculations for tables...
3
by: JBH | last post by:
I'm having difficulty removing spacing between two rows in a table. Below is a copy of my source code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>About...
0
by: Thomas Scheiderich | last post by:
I have a table that has 3 image slices. The middle slice changes size based on size of browser window. This works great. My client wants the date to show over the image on the right. So what I...
1
by: James Black | last post by:
I am dynamically generating a table in IE to display some information. I will probably change it to divs later, but I just want to get it working properly first. In my div I have the following...
2
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using...
6
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.