Solved

Formatting line height in page, table, table cell, form.

Posted on 1998-12-17
7
124 Views
Last Modified: 2010-04-09
When I enter text separated with "enter" (carriage return)
both in a page and in a table cell it becomes a huge gap between the two lines. How do I make the gap smaller?

It looks like this:
This is how it is   the first line....
            This is the gap...how do I make this smaller?
This is how it is   the next line....

This is what I want:
This is what I want    the first line....
This is what I want    the next  line...

I want to make this work both for the page in general and
for table in general and individual table cells, and forms
also if possible.

Erot / Norway
0
Comment
Question by:erot
  • 3
  • 3
7 Comments
 
LVL 4

Expert Comment

by:rafistern
ID: 1840714
If I understand what you want, it is to make lines of text on the screen be closer in an html page.

THis can only be done in IE4 or NS4. Add a style to the body of the page or the element desired like this:

<body style="line-height:0.8em">

for example will make all lines of text in the document be spaced at 80% of the default.

<td style="line-height:1.25em">

would space all lines of text in the table cell at 125% of the default.

Is this what you wanted to know? Tell me and I will submit as an answer.


0
 
LVL 1

Expert Comment

by:slinky
ID: 1840715
How are you putting an "enter" into the text?
Are you using <br>?

Alternatively, put each line in a separate table cell and
set the table up like
<table cellpadding=0 cellspacing=0>
0
 

Author Comment

by:erot
ID: 1840716
rafistern....thanks...can you supply a dummy answer so I
can give you the points.

Erot /Norway
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 4

Accepted Solution

by:
rafistern earned 40 total points
ID: 1840717
The answer is my first comment.
0
 

Author Comment

by:erot
ID: 1840718
Hello again...I thougt your answer should work...but
the code only affects lines which has not been invoked by the
carriage return.

Eks: If I enter text in a table-cell untill I reach the right
cell-border (and keep on writing) then the next line get the smaller spacing. (but this was OK in the beginning...the result now is that these lines is printed on top of each other...but on the other hand..this was not the problem......so...

Eks: If I enter some text, but before I reach the right cell-border I hit the "Carriage-return".....then the line-hight is
unaffected......so how do I change this line-height?????
0
 
LVL 4

Expert Comment

by:rafistern
ID: 1840719
Do you mean <br> or <p> by carriage return?

I cannot see any problem with the <br> tag in either IE or NS.

With the <p> tag you can do this <p style="margin-top:0em"> to cancel the line break that it introduces.
0
 

Author Comment

by:erot
ID: 1840720
Thank you for the answer.....
I got it right now...


0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

840 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