I have something similar to that:
<table>
<tr>
<td>Hello,<br/>World!</td>
</tr>
</table>
Both lines
Hello,
World!
are displayed too close to one another. Any way to increase spacing between them (by a portion of a line width (without another <br/>
))?
Those who need the line spacing to be set to 1.5 should use line-height: 1.5 . And if you want the spacing to return to its original value (before you messed with it), use line-height: normal .
To create extra spaces before, after, or in-between your text, use the (non-breaking space) extended HTML character. For example, with the phrasing "extra space" using a double space, we have the following code in our HTML.
As in print layout programs, you can add space between paragraphs using margin-bottom or margin-top in your CSS, used below in the paragraph element. Compare the difference between the one without extra space (below, left) to the one with the added margin-bottom between paragraphs (below, right).
The line-height CSS property defines the space between two inline elements. The typical use is, to space-out text. You can see people comparing it to 'leading' which is a term used in typography that refers to the space between the baseline of two lines of text.
Here's a full example of how to make the line spacing within <td>
s one and a half times the height of the font:
<html><head>
<style>
td {
line-height: 150%;
}
</style>
</head>
<body>
<table>
<tr>
<td>Hello,<br/>World!</td>
</tr>
</table>
</body></html>
Use line-height
to adjust the, well, line height. So in your case line-height: 2
will double the line height.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With