Solved

CSS to handle row spacing

Posted on 2009-07-14
5
1,257 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
  • 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Modify Table Width 6 23
CSS Question 5 39
Max-width on individual images in grid 4 51
two div layout one vertical other horizontal. 5 6
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now