Multiple spaces on html, jsp pages show only one space

The maintenance system found that a user reported a problem, and found that there were multiple spaces on the jsp page, and only one space was displayed.

Check that "A B" exists in the corresponding table field of the background database, the code read data is printed as "A B", but only "AB" is displayed when the jsp page is displayed

 

The solution is very simple: replace the space character " " in the java background with the character "   "

 

Explanation found

See the explanation of the space character in html:

 

 : It is called No-Break Space, the full name is No-Break Space, it is the most common and we use the most space, most people may only come into contact with  , it is the space generated by pressing the space key. In HTML, if you use the space bar to generate this space, the space is not cumulative (only 1). It can only be accumulated using html entity representation, and the width of the space is obviously and strongly affected by the font.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326880487&siteId=291194637