HTML remove space between integer and fraction when using ⁄ - html

How can I remove the space in a mixed number between the whole number (e.g. 2) and the fraction (e.g. 7⁄16) when using ⁄?
2 7⁄16 displays 2 7⁄16 (w/ a space between 2 and the fraction)
27⁄16 displays 27⁄16
So it display as... 2⅙ as this would for 2⅙
Is there a code, essentially the 'reverse' of for an 'empty space'?

You could use a zero-width non-joiner character (‌)(https://htmlhelp.org/reference/html40/entities/special.html)
2‌7⁄16

This seems to work:
2­7⁄16 produces 2­7⁄16
I can live with that, though if there are better ways to do this, please advise.

Related

Can you create a pattern for HTML input fields with a minimum number of letters of a certain type?

I want to create a pattern for an HTML input field that needs to have at least 10 numbers in it and may also have spaces and a plus sign on top of that, but it's not required.
It's important that numbers and spaces can be mixed though. Also, the whole field can only have 17 characters all in all.
I'm not sure if it's even possible. I started doing something like that:
pattern="[0-9+\s]{10,17}*"
But like this, it's not guaranteed that there are at least 10 numbers.
Thanks in advance! Hope the question doesn't exist already, I looked but couldn't find it.
You can use
pattern="(?:[+\s]*\d){10,17}[+\s]*"
The regex matches
(?:[+\s]*\d){10,17} - ten to seveteen occurrences of zero or more + or whitespaces and then a digit
[+\s]* - zero or more + or whitespaces.
Note the pattern is anchored by default (it is wrapped with ^(?: and )$), so nothing else is allowed.

Mysql multiple replace query leaving unwanted leading white space. How to remove it?

People,
Currently i have a string mysql field Class on a table.
It´s a code plus a description. I need to extract the description only (without a whitespace in the begining of the string).
The rule of formation of this field data follows:
N.N Description(without any digit or dots) or N.N. Description (without any digit or dots)
Where N is a number between 1 and 10.
I´ve tried this multiple replace but it remains two cases with one leading white space that i could not remove:
' Suspension'
and
' Reduction'
My multiplce replace is:
REPLACE(REPLACE(REPLACE(TRIM(BOTH ' ' FROM (REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(class,'.',''),'1',''),'0',''),'2',''),'3',''),'4',''),'5',''),'6',''),'7',''),'8',''),'9',''))),'\r',''),'\t',''),'\n','')
What this leading white space could be so i can replace it? What could be missing?
Or anyone have a better idea how to solve this?
Probably you are replacing with white space and this the modified string ends up with that. Why can't you use TRIM() function on your final replaced string to get rid of those leading spaces.

difference between " " and nbsp; or " "

Hello I am trying to compile an EPUB v2.0 with html code extracted from Indesign. I have noticed there are a lot of "special characters" either at the beginning of a paragraph or at the end. For example
<p class="text_indent0px font_size0_8em line_height1_325 margin_bottom1px margin_left0px margin_right0px sans_serif floatleft">E<span class="small_caps">VELYNE</span> </p>
What is this
and can I either get rid of it or replace it with a "nbsp;"?
&#9
Is the ascii code for tabs. So I guess the paragraphs were indented with tabs.
If you want to replace them with then use 4 of them
That would be a horizontal tab (i.e. the same as using the tab key).
If you want to replace it, I would suggest doing a find/replace using an ePub editor like Sigil (http://sigil-ebook.com/).
represents the horizontal tab
Similarly represent space.
To replace you have to use
In the HTML encoding &#{number}, {number} is the ascii code. Therefore, is a tab which typically condenses down to one space in HTML, unless you use CSS (or the <pre> tag) to treat it as pre formatted text.
Therefore, it's not safe to replace it with a non-breaking or a regular space unless you can guarantee that it's not being displayed as a tab anywhere.
div:first-child {
white-space: pre;
}
<div> Test</div>
<div> Test</div>
<pre> Test</pre>
See https://developer.mozilla.org/en-US/docs/Web/CSS/white-space and http://ascii.cl/
is the entity used to represent a non-breaking space
decimal char code of space what we enter using keyboard spacebar
decimal char code of horizontal tab
and both represent space but is non-breaking means multiple sequential occurrence will not be collapsed into one where as for the same case, ` will collapse to one space
= approx. 4 spaces and approx. 8 spaces
There are four types of character reference scheme used.
Using decimal character codes (regex-pattern: &#[0-9]+;),
Using hexadecimal character codes (regex-pattern: &#x[a-f0-9]+;),
Using named character codes (regex-pattern: &[a-z]+;),
Using the actual characters (regex-pattern: .).
Al these conversions are rendered same way. But, the coding style is different. For example, if you need to display a latin small letter E with diaeresis then you could use any of the below convention:
ë (decimal notation),
ë (hexadecimal notation),
ë (html notation),
ë (actual character),
Likewise, as you said, what should be used (a) (decimal notation) or (b) (html notation) or (c) (decimal notation).
So, from the above analogy, it can be said that the (a), (b) and (c) are three different kind of notation of three different characters.
And, this is for your information that, (a) is a Horizontal Tab, the (b) one is the non-breaking space which is actually   in decimal notation and the (c) is the decimal notation for normal space character.
Now, technically space at the end of the paragraph, is nothing but meaningless. Better, you could discard those all. And if you still need to use space inside <pre> elements, not in <p> or <div>.
Hope this helps...

Advanced HTML multiline formatting - removing not need spaces from new lines

Question is very simple but I am not found solution yet - probably it is not possible or very hard to find since it is very trivial.
Question is how to avoid adding spaces in formatted HTML after new line - especially in list of values.
First example see example:
1, 2
It produces required HTML like this:
1, 2
Now another example which not works:
1
,
2
It produces invalid HTML like this:
1 , 2 required is 1, 2
How to achieve same result as in first example but using multiline text layout - I know that we could do it in one line but want to do in many lines to simplify program code (not HTML).
It works as defined: in normal content, a newline is equivalent to a space. There is no way to change this principle in HTML. Just divide you content into lines so that the principle works for you, not against you. That is, break a line only at a point where a space is OK.

How can I preserve leading white space in PDF export of reporting services

I have some leagacy reporting data which is accessed from SSRS via an xml web service data source. The service returns one big field containing formatted plain text.
I've been able to preserve white space in the output by replacing space chars with a non-breaking space, however, when exporting to PDF leading white space is not preserved on lines that do not begin with a visible character. So a report that should render like this:
Report Title
Name Sales
Bob 100.00
Wendy 199.50
Is rendered like this:
Report Title (leading white space stripped on this line)
Name Sales (intra-line white space is preserved)
Bob 100.00
Wendy 199.50
I've not been able to find any solution other than prefixing each line with a character which I really don't want to do.
Using SQL 2005 SP3
I googled and googled the answer to this question. Many answers included changing spaces to Chr(20) or Chr(160). I found a simple solution that seems to work.
If your leading spaces come from a tab stop replace "/t" with actual spaces, 5 or so
string newString = oldString.Replace("/t"," ")
In the expression field for the textbox I found that simply adding a null "Chr(0)" at the beginning of the string preserves the leading spaces.
Example:
=Chr(0) & "My Text"
Have you tried non-breaking spaces of the ASCII variety?
=Replace(Fields!Report.Value, " ", chr(160))
I use chr(160) to keep phone numbers together (12 345 6789). In your case you may want to only replace leading spaces.
You can use padding property of the textbox containing the text. Padding on the left can be increased to add space that does not get stripped on output.
I have used this work around:
In the Textbox properties select the alignment tab.
In the Padding option section edit the right or left padding(wherever you need to add space).
If you need to conditionally indent the text you can use the expression as well.