Are there other whitespace codes like   for half-spaces, em-spaces, en-spaces etc useful in HTML?
Yes, many.
Including, but not limited to:
- [ ] hair space :
 
- [ ] 6-per-em space :
- [ ] narrow no-break space :
- [ ] thin space :
- [ ] 4-per-em space :
 
- [ ] non breaking space :
- [ ] punctuation space :
 
- [ ] 3-per-em space :
 
- [ ] en space :
- [ ] figure space :
 
- [ ] em space :
span{background-color: red;}
<table>
<tr><td>non breaking space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>narrow no-break space:</td><td> <span> </span></td></tr>
<tr><td>en space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>em space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>3-per-em space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>4-per-em space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>6-per-em space:</td><td> <span> </span></td></tr>
<tr><td>figure space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>punctuation space:</td><td> <span> </span> or <span> </td></tr>
<tr><td>thin space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>hair space:</td><td> <span> </span> or <span> </span></td></tr>
</table>
Smaller space than
I agree with the other answerers, you are definitely using the wrong tool. If you are a beginner and CSS is over your head, use a table, it's really simple:
<table>
<tr> <td>Email</td> <td>whatever</td> </tr>
<tr> <td>Tel.</td> <td>012345</td> </tr>
</table>
However for anybody who is really in need of unusual spaces, Wikipedia has an overwhelming selection. Notably there is thin space (
, breaking) and Narrow No-Break Space (#x202F;
, non-breaking).
Tab space instead of multiple non-breaking spaces ( nbsp )?
It's much cleaner to use CSS. Try padding-left:5em
or margin-left:5em
as appropriate instead.
HTML equivalent to ...that DOES break;
If you want a wider-than-normal space that doesn't prevent line breaks, you probably want either an en space (U+2002,
) or an em space (U+2003,
). Typically, an en space is twice as wide as a normal space, and an em space is four times as wide.
HTML - Add certain spaces. so each row is equal vertically
https://www.w3schools.com/css/tryit.asp?filename=trycss_table_align
Try with table & text-alight
Related Topics
Make Link in Table Cell Fill the Entire Row Height
Html5 Validation When the Input Type Is Not "Submit"
CSS Only Animate Draw Circle with Border-Radius and Transparent Background
Restrict Future Dates in HTML5 Date Input
How to Override Inline !Important
Play Sound File in a Web-Page in the Background
What Is the Character Limit on Url
How to Upload a File to My Server Using HTML
Change Name of Download in JavaScript
How to Create a Transparent Triangle with Border Using CSS
Workaround for Href="File://///..." in Firefox
CSS Transition - Eases in But Doesn't Ease Out
Can a Span Be Closed Using <Span />
Z-Index Not Working with Position Absolute
Selecting the Last Element Among Various Nested Containers
What's the Purpose of the HTML "Nonce" Attribute for Script and Style Elements