How to anchor the first HTML child to the left and the last one - to the right - html

Please, consider the following trivial example: http://jsfiddle.net/mark69_fnd/vtLrt/
As you can see, it prints:
A1 B1
A2 B2
A3 B3 C3 D3 E3 F3 G3
What I would like to see is:
A1 B1
A2 B2
A3 B3 C3 D3 E3 F3 G3
I.e. the first element is anchored to the left (A1, A2, A3) and the last one - to the right (B1, B2, G3).
Can I do it without JS?

Edit: you said you want B1, B2, B3 to the extreme right, but your example shows something different
Just give float: right; to .anchorToRight
Demo
CSS
.anchorToRight {
float: right;
}

I have seen you have added class anchorToRight. Float this class to right.
.anchorToRight{
float:right;
}

Hi now Define your Class .char.anchortoRight in your css float : right
As like this
.char.anchorToRight{
float:right;
}
Live demo

Add this css into your css file.
.anchorToRight{
float:right;
}

Related

Can I download a Google sheet cell as a JS file?

If my Google sheet looks like:
A B C D
1 Template {content} document.write('{content}')
2
3 Name Value Output Button
4 Test A test =SUBSTITUTE(c$1, b$1, B4) [A button with a custom function...]
5 Dummy Just a dummy =SUBSTITUTE(c$1, b$1, B5) [A button with a custom function...]
6 Foo Foo this =SUBSTITUTE(c$1, b$1, B6) [A button with a custom function...]
7 Bar Bar that =SUBSTITUTE(c$1, b$1, B7) [A button with a custom function...]
Can I use a custom function that will make each button download its related cells as a JS file? For example, clicking D4 should save C4 as {A4}.js (i.e. Test.js), so that Test.js will contain:
document.write('A test')

Two-axis table layout with css-grid

Resources like complete-guide-to-grid on css-tricks or grid by example are wonderful, yet I cannot figure out how to build a two-axis table layout.
The data for this layout is a simple weekly schedule, where each day has a 0-n categories and each category has 0-n dishes. The data looks something like this (pseudo-code):
DAY: { CATEGORY: [DISH] }
e.g.
monday: { a: [1, 2], b: [6], d: [5] },
tuesday: { b: [25], e: [0] },
...
friday: { a: [10], b: [9] },
The layout should look like this (note the empty top-left corner):
. MO TU WE TH FR
A a1 a10
a2
B b6 b25 b9
D d5
Now, having spent years nesting divs to build layouts, I attempted to design this "layout-in", as is the mantra of css-grid, structuring the html in a way that is decoupled from the target-layout. See this codepen for an example structure.
My first attempt was using grid-areas, like this:
.grid {
grid-template-areas:
". 1 2 3 4 5"
"a a1 a2 a3 a4 a5"
"b b1 b2 b3 b4 b5";
// ...
}
This "works", but now I have to create a class for every single cell in the table, which is silly.
Then I tried to create areas for each axis and one for the center cells:
.grid {
grid-template-areas:
". n n n n n"
"s x x x x x";
}
This does not work. Assigning x to each cell just stacks them on top of each other in the first x column/row, same thing with n up top. Also, the pattern does not repeat, so we end up with only two rows.
Then I thought about nesting grids, adding another grid under n and x. But this defeats the "layout-in" promise, so I decided against it.
I believe I either fundamentally misunderstand areas, or what I am trying to do is not possible without nesting grids. Any input, or an example two-axis layout using css-grid would be greatly appreciated!
Since you're working with tabular data a <table> element might be more appropriate than trying to use css grid.

Combine Cell Contents into another Cell

So Im working on a Spreedsheet in Google Docs, my question is: I would like to combine say columns A,B,C,ect... in column I with a space between them. I'm currently using something like this =A1&" "&B1&" "&C1&" "&ect... This works fine and dandy but if the cell is blank I would like to ignore it. Should this be done via script or formula?
So in my head I'm thinking if cell A = value then grab it and combine it with B (if that contains a value if not leave blank or skip) But I'm not good at PHP So any help would be great!!! Happy NY to everyone ; )
Here's a custom function that will return a string with the given range values joined by the given separator. Any blanks are skipped.
function joinVals( rangeValues, separator ) {
function notBlank(element) {return element != '';}
return rangeValues[0].filter(notBlank).join(separator);
}
Examples:
A B C Formula Result
1 1 2 3 =joinVals(A1:C1," x ") 1 x 2 x 3
2 1 2 =joinVals(A1:C1," x ") 1 x 2
3 1 3 =joinVals(A1:C1," x ") 1 x 3
4 1 2 3 =joinVals(A1:C1) 1,2,3
By using IF and ISBLANK you can determine whether a cell should be included, or ignored. Like this:
=if(ISBLANK(A1),"",A1 & " ")
That reads "if the cell is blank, ignore it, otherwise echo it with a trailing space." You can daisy-chain a series of those together:
=if(ISBLANK(A1),"",A1 & " ")&if(ISBLANK(B1),"",B1 & " ")&if(ISBLANK(C1),"",C1 & " ")...
That gets pretty long and repetitive. Adding ARRAYFORMULA and JOIN, we can have that repetitive piece apply across a range of cells, A1:F1 in this case:
=JOIN("",ARRAYFORMULA(IF(ISBLANK(A1:F1),"",A1:F1&" ")))

Place dynamic marking under bar line (move dynamics horizontally)

I want to create a crescendo that extends over two measures.
The following code
\relative c'
{
c4\pp\< c4 c4 c4 | c1\ff
}
compiles to
which is almost what I want. However, I would like the ff markings to appear further to the right, directly under the very next bar line, to indicate that the last whole tone should have a gradual increase in volume as well.
How can I achieve this?
You could use spacer rests to "move" the fortissimo to the end of the second bar:
\relative c'
{
c4\pp\< c4 c4 c4 |
<< c1 { s2. s4\ff } >>
}
This results in:

Text Field from right to left

I have a input text feild,basically we will right from left to right,i want modify such that, e.g if we multiply 23 x 2 , we will first write 6 then 4 to make it 46 .rather 4 first then 6,
it should appear as 46 only
You can do it with split(aString) and join(aString).
Convert the input string into an array, inverse it and then put it back into a string.
var textInput:String = input_txt.text;
var inputArr:Array=textInput.split("");
inputArr.reverse();
var reverseStr:String=inputArr.join("");
input_txt.text = reverseStr;
See an example here: http://www.ilike2flash.com/2009/08/reversing-string-in-actionscript-3.html