How can I write Persian words Left-to-Right? - html

I need to write Persian words in left to right mode for write Math formula in textarea html css but I cant get it working with direction:ltr; or other solutions to fixed it with direction.
I tested align-text, direction, dir Attribute and another things...
I want my result is equals to this:
User writes: سجاد+آرش+تست+تست
HTML input Show this: تست + تست+ آرش + سجاد

It's because when you write تست+آرش , the HTML see it one word and just when you use space (" ") HTML break your word.
You can place your Persian words inside ( and ).
So instead using this:
سجاد+آرش+تست+تست
use this:
(سجاد)+(آرش)+(تست)+(تست)

Related

Using Code <> As Actual Text

Really having trouble with this and can't find any results on it.
I want my html text to utilize the carrots <> for some of my text.
Specifically for a navbar menu item. But I can't seem to build it without activating the text as an actual div.
I want it to say "< Dev>" without using quotes or spaces, but it when I take the quotes/spaces away it activates it as a div. How do I keep the entire message "< Dev>" without turning it into a div item?
E.g:
<p> Welcome to my <Dev> portfolio</p>
Also what is the term used to override reserved code functions as text? Will help me research answers for other issues too. Like when using & as text and not as code.
Thanks for the assistance!
You'll want to use <p> Welcome to my <Dev> portfolio</p>
You can find a list of HTML character codes Here
Try using the html unicode values for those characters instead.
Welcome to my &60Dev&62 portfolio
Sorry it looks like this forum reads those unicode characters and prints them correctly. Add # signs at the after the & characters to get the html code.

How to get element by xpath and inner text?

I am trying to locate a UI popup using xpath and inner text. The popup html is like this:
Hello ? {some elements} What would you like to do today {more elements} Play or Die ? {Yes button, No button}.
I want to get this element by using something like this:
//div[contains(#innerText, 'Hello ? What would you like to do today Play or Die ?')]
How do I do this ? Or is there a better way to find this popup ? There are no Ids or permanent classes here. Moreover the DOM structure is variable.
You should be able to use xpath ver2's matches function:
//div[matches(text(), 'Hello ?\w+ What would you like to do today \w+')]
Which allows regex.
Assuming that the interleaving elements contain no inner text, you can use . instead of #innerText to get concatenation of all text nodes within context element (the div in this case). Combine . with normalize-space() to remove leading and trailing whitespace characters, as well as to normalize consecutive whitespace characters into single space. With normalize-space() the . can be removed as it is the default parameter :
//div[contains(normalize-space(), 'Hello ? What would you like to do today Play or Die ?')]

right side alt shift in sql

How does one append all lines in a SQL query with text?
In order to add something to the front of my lines of code I can use Alt+Shift down the left side and type something to change
example-1
example-12
example-123
example-1234
example-12345
to
a.example-1
a.example-12
a.example-123
a.example-1234
a.example-12345
but if I want to add something to the right side, it turns out like this
a.example-1*
a.example-1*
a.example-1*3
a.example-1*34
a.example-1*345
when i want it to look like this
a.example-1*
a.example-12*
a.example-123*
a.example-1234*
a.example-12345*
So, how do I do this? Is it possible to append all lines with something with Alt+Shift or is there another method?
*Edit example
To clarify, I need to edit the text in my SQL code, not the text within my tables and such. Ex.:
SELECT TOP 1000
[day]
,[workout_name]
,[reps]
FROM [tom].[dbo].[workout_routine]
but instead of having the commas at the beginning of [day], [workout_name], let's say I need them at the end, like:
SELECT TOP 1000
[day],
[workout_name],
[reps]
FROM [tom].[dbo].[workout_routine]
Because Alt+Shift works and aligns at any column of text, but I need to know if there is a way to be able to add something to the end of lines of differing lengths.
There is a Concat function in mysql.
Select concat(row, ' text after row') from table
If you're looking to modify a script, you can use Regex to replace $ which represents the end of line character. So if you were in Notepad++, you can do a find and replace for $. Make sure you allow Regular expression in the search mode.

ruby tags for Sphinx/rst

I create HTML documents from a rst-formated text, with the help of Sphinx. I need to display some Japanese words with furiganas (=small characters above the words), something like that :
I'd like to produce HTML displaying furiganas thanks to the < ruby > tag.
I can't figure out how to get this result. I tried to:
insert raw HTML code with the .. raw:: html directive but it breaks my line into several paragraphs.
use the :superscript: directive but the text in furigana is written beside the text, not above.
use the :role: directive to create a link between the text and a CSS class of my own. But the :role: directive can only be applied to a segment of text, not to TWO segments as required by the furiganas (=text + text above it).
Any idea to help me ?
As long as I know, there's no simple way to get the expected result.
For a specific project, I choosed not to generate the furiganas with the help of Sphinx but to modify the .html files afterwards. See the add_ons/add_furiganas.py script and the result here. Yes, it's a quick-and-dirty trick :(

Perl formatting (i.e.sprintf) not retained in html display

I have ran into a bit of problem. Originally, I have the following input of the format:
12345 apple
12 orange
I saved the first column as $num and second column as $fruit. I want the output to look like this (see below). I would like for the output to align as if the $num are of all the same length. In reality, the $num will consists of variable-length numbers.
12345 apple
12 orange
As suggested, I use the following code:
$line = sprintf "%--10s %-20s", $num, $fruit;
This solution works great in command-line display, but this formatting is not retained when I try to display this via HTML. For example..
print "<html><head></head><body>
$line
</body></html>";
This produces the same output as the original before formatting. Do you guys have a suggestion as to how I can retain the sprintf formatting in html web-based display? I try to pad the $num with whitespaces, but the following code doesn't seem to work for me.
$num .= (" " x (10 - length($num)));
Anyways, I would appreciate any suggestions. Thanks!
HTML ignores extra whitespace. And the fact that it's probably displaying with a proportional font means it wouldn't line up even if the extra spaces were there.
The easy option is to just surround the text with <pre> tags, which will display by default with a monospace font and whitespace preserved. Alternatively, you can have your code generate an HTML table.
HTML compresses all consecutive spaces down to one space. If you want your output to be lined up like a table, you have to actually put the values in an HTML table.
The 'pre' in <pre> means preformatted, which exactly describes the output of a sprintf() statement. Hence the suggestion from friedo and I suspect, others.