How to Add Break Plus Space to Code \r\n\r\n - return

I am trying add line break plus a space ( ). I know I can do
\r\n\r\n
to get the line break but how do i also add a space. I know in HTML i can do this
<br>
But how would I achieve \r\n\r\n + Space. What characters do i need to add to achieve this. Thank you.

you can't do a return (\r) in html.
You'll need to use Javascript if you want to remove content from an element then replace it with other content.

Related

Break line defaultvalue of textarea

I have textarea with defaultvalue like this:
<textarea>
One Two Three
</textarea>
How can i display field like this:
One
Two
Three
Assuming you're referring to the placeholder, this has been answered on here: Insert line break inside placeholder attribute of a textarea?
Note there's no simple way, just some hacks that may work in some browsers and not others like using &#10 where you want the line break.
<textarea placeholder="one
two">
</textarea>
Depending on what you're going for you could set the width or use something like col="5" to force each word to the next line, but that also affects the user input.
My solution here
I replace space character by <br/> tag
Solution:
Break with \r\n with default text area. It will work.
"One\r\nTwo\r\nThree\r\nFour"

UILabel word wrapping brings extra word to next line when there is enough space for it

Under certain circumstances, UILabel seems to bring an extra word to new line even when there is enough space for it, for example,
If one more word is appended,
Even if I force the width of the label to become something like below, it still moves the word consists of "c"s to the next line,
I've tried twisting the configuration of the UILabel, but seems it behaves the same unless I set the line breaking mode to character wrap, below is the configuration for the above cases,
And the constraints (in the first two cases, the trailing ),
Is there any reason for this particular behaviour and can I fix this? It looks weird in this way leaving that space emptied.
this is the default behavior since iOS 11, to fix orphaned words. No way to shut it off
to fix it
use the text as attributed text
or
use UItextview and turn of the scroll, edit option
or
use the custom label here
Get each line of text in a UILabel
You should set the line break to character wrap, because the letters after the space will be recognized as a word.
Hey I know this is late but I just figured out that you can cheat the system by adding a bunch of spaces at the end of the text.
If text of UILable may be changed, then it's still possible to use quick-dirty hack with "\n" - new line symbol.
Text "Aaaaaaaaaaaaaa bbb cccccccccc\ndddddd" will force UILabel to display:
Aaaaaaaaaaaaaa bbb cccccccccc
ddddddd
In Interface Builder new line can be inputted with Ctrl + Enter
If u use wordWrap, it tries to keep words in full form, as a result of this, it goes to next line. If you use character wrap, it will break on characters, and push the chars onto next line.
For Example:-
My name is ABCXXXX and I (have space here)
love myself.
Solution:-
Use NSMutableAttributedText and write love\n. It will make the "love" be in the space myself in the next line.

Not Aligning the data inside a column in pdf generated by using jspdf auto table

I have attached my problem in the below snap , I dont know how to align the data in particular manner inside a column using jspdf-autotable generated pdf.
I have a requirement to show the parent step and child step in a column . so In my code I wrote a logic inside drawCell() for every child step, added 10Spaces and print in pdf.
Inside drawCell() I got cell.text data in the form of array of Strings. I easily added 10 spaces for every string like below
[" String1"," String2"," String3"," TOOLONG STRING dfhdjhdfd..fsdd..."]
If the String is too long some of the letters are hided at the edge of the row ,jspdf tries to place a every string in the same line ,below image shows the problem I am highlighted in that, Please give me some suggestion I am not getting any Idea How to fix it ..Please bear with my English
Try to use the createdCell hook instead of the drawCell hook to add the spaces. It is executed before the width is calculated.

Is it possible to add a vertical line beside a paragraph with UITextView/UILabel?

I'm looking to build a UITextView/UILabel that allows for quotes to be distinguished visually. The most common way to do this is seemingly a vertical line to the left of the quoted portion.
An example would be [this article] from Daring Fireball, notice the line by the quoted portion:
How would I go about accomplishing this with UITextView/UILabel? I can figure it out in UIWebView using CSS, but unfortunately UIWebView simply won't work in this project (due to these quotes being in numerous UITableViewCells). Similarly manually indenting paragraphs wouldn't work as it could appear anywhere in a block of text, perhaps the third paragraph, so I wouldn't necessarily know where to put it.

How do I do a manual line break in an jQuery Mobile button?

I want to have a button with multiple lines. I could add white-space:normal but that does not allow manual line breaks. I have tried with <br> and
but they don't work as a jQM button is text only.
Note that I do not want automatic line-breaks, but I want to decide myself where to put them.
Nor do I want to change the height of the button. No, I want to add extra linebreaks.
i.e. I want to be able to have a button with
Text
like
this
instead of
Text like this
Is there a way around this limitation?
Ok, there is a way to do it. Since I use GWT I can do
JQMButton b = new JQMButton("dummy text");
b.getElement().setInnerHTML("this<br>text<br>works");
a couple of ways to do it
reduce the width of your button, the text would lay out itself in lines
do a shift-enter while typing the text or try a '\n' like this Text \n like \n this

Resources