?
Solved

CSS to handle row spacing

Posted on 2009-07-14
5
Medium Priority
?
1,264 Views
Last Modified: 2012-05-07
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

0
Comment
Question by:saturation
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:erikTsomik
ID: 24854445
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>
0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 24854468
as for verical spacing I would just put a blank row
<tr><td></td></tr>
0
 

Author Comment

by:saturation
ID: 24859758
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?
0
 
LVL 2

Accepted Solution

by:
toymachiner62 earned 2000 total points
ID: 24862912
Try this for the second part:

tr {
    padding:10px 0 10px o;
}
0
 

Author Comment

by:saturation
ID: 24863081
It's still rendering the same as without the TR style...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question