Link to home
Start Free TrialLog in
Avatar of saturation
saturation

asked on

CSS to handle row spacing

I am trying to use CSS to a) get the field captions vertically closer to the corresponding form fields, and b) try to put more vertical space between table rows.   Without altering any of the existing HTML, how can I do this?  I've tried margin, border, line-height, padding, etc--in multiple combinations, but can't seem to get it to work correctly.
<html>
<head>
<style>
 
.CONTENT{
	color:#003B71;
	font-family: Georgia, Arial, Helvetica, sans-serif;
	font-size:12px;
}
 
.VIEWBOXCAPTION{
	font-family: Arial, sans-serif;
	font-size: 12px;
	color:#003B71;
	font-weight: 900;
	height:50%;
	padding-bottom:10px;
}
 
.EDIT{
	background:#F7F7F7 ;
	font-weight:normal;
	color:#003B71;
	font-family: Helvetica, sans-serif;
	font-size:11px;
	width: 200px;
}
 
</style>
</head>
 
<body>
 
<table CLASS=CONTENT>
 
	<tr><td valign=top>
			<SPAN class=VIEWBOXCAPTION>capt 1</span><br>
			<SPAN class=VIEWBOXCAPTION ><input type=text class=edit></span>
		</td>
		<td  valign=top>
			<SPAN class=VIEWBOXCAPTION>capt 2</span><br>
			<SPAN class=VIEWBOXCAPTION ><input type=text class=edit></SPAN>
		</td>
		</tr>
	<tr><td  valign=top>
			<SPAN class=VIEWBOXCAPTION>capt 1</span><br>
			<SPAN class=VIEWBOXCAPTION ><input type=text class=edit></span>
		</td>
		<td  valign=top>
			<SPAN class=VIEWBOXCAPTION>capt 2</span><br>
			<SPAN class=VIEWBOXCAPTION ><input type=text class=edit></SPAN>
		</td>
		</tr>
</table>
 
</body>
</html>

Open in new window

Avatar of erikTsomik
erikTsomik
Flag of United States of America image

try this
<html>
<head>
<style>
 
.CONTENT{
        color:#003B71;
        font-family: Georgia, Arial, Helvetica, sans-serif;
        font-size:12px;
}
 
.VIEWBOXCAPTION{
        font-family: Arial, sans-serif;
        font-size: 12px;
        color:#003B71;
        font-weight: 900;
       
        padding-bottom:10px;
}
 
.EDIT{
        background:#F7F7F7 ;
        font-weight:normal;
        color:#003B71;
        font-family: Helvetica, sans-serif;
        font-size:11px;
        width: 200px;
}
 
</style>
</head>
 
<body>
 
<table CLASS="CONTENT">
 
        <tr>
                              <td valign="top">
                        <span class="VIEWBOXCAPTION">capt 1</span><br>
                        <span class=VIEWBOXCAPTION><input type=text class="edit"></span>
                </td>
                <td  valign=top>
                        <SPAN class=VIEWBOXCAPTION>capt 2</span><br>
                        <SPAN class=VIEWBOXCAPTION ><input type=text class=edit></SPAN>
                </td>
                </tr>
        <tr><td  valign=top>
                        <SPAN class=VIEWBOXCAPTION>capt 1</span><br>
                        <SPAN class=VIEWBOXCAPTION ><input type=text class=edit></span>
                </td>
                <td  valign=top>
                        <SPAN class=VIEWBOXCAPTION>capt 2</span><br>
                        <SPAN class=VIEWBOXCAPTION ><input type=text class=edit></SPAN>
                </td>
                </tr>
</table>
 
</body>
</html>
as for verical spacing I would just put a blank row
<tr><td></td></tr>
Avatar of saturation
saturation

ASKER

Hi, the first part worked, but as I mentioned in my description above, I don't have direct control over the HTML--only the CSS--so I have to adjust the row height through CSS.   How do I do this?
ASKER CERTIFIED SOLUTION
Avatar of toymachiner62
toymachiner62
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's still rendering the same as without the TR style...