File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes How to reduce cell heigt in a Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to reduce cell heigt in a Table" Watch "How to reduce cell heigt in a Table" New topic
Author

How to reduce cell heigt in a Table

Kishan Kumar
Ranch Hand

Joined: Sep 26, 2000
Posts: 130
Hi,
Iam attaching a html code below which displays three rows i.e.
First Name, Last Name and Email Address and each having a corresponding textbox for user to enter. On putting the table border as 1 I see that all the space inside the first row is occupied. But the second and third row there is space around the cells. I do not want this extra space inside the cell. I could not determine what is contributing to the height of the cell and why is that only the first row has no space around it while the second and third row has.
<HTML>
<HEAD>
<link rel="stylesheet" href="bcs_styles.css" type="text/css">
</HEAD>
<BODY>
<FORM name="f1" method="post" value="">
<TABLE border="1" cellspacing="0" cellpadding="0">
<TR> <!-- First Name -->
<TD width="39%" align="right" class="boldlabels">First Name :</TD>
<TD width="1%"> </TD>
<TD width="60%" align="right">
<INPUT type="text" value="Kishan Kumar" name="first_name_in"
size="35" class="normal" maxlength="40"></TD>
</TR>

<TR> <!-- Last Name -->
<TD width="39%" height="39" align="right" class="boldlabels">Last Name :</TD>
<TD width="1%" > </TD>
<TD width="60%" height="39" align="right">
<INPUT type="password" value="Vemuru" NAME="last_name_in"
size="35" class="normal" maxlength="40"></TD>
</TR>


<TR> <!-- Email Address -->
<TD width="39%" height="39" align="right" class="boldlabels">
E-mail address :</TD>
<TD width="1%" > </TD>
<TD width="60%" height="39" align="right">
<INPUT type="text" value="kishan_kumar_v@yahoo.com" NAME="email_address_in"
size="35" class="normal" maxlength="40"></TD>
</TR>
</TABLE>
</BODY>
</HTML>
I would like to see all the three rows just below each other without any space between them. Cellpaddig and cellspacing is not helping either.
Thanks in advance
Kishan Kumar
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
you are assigning the cell a height which is not allowing them to be any closer....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to reduce cell heigt in a Table