Container fluid on one side only - uikit

I have a 2 columns grid in a uk-container and what I actually want to achieve is for the second column to take up the rest of the horizontal space available. What would be the best pratice using uikit? Thanks.

you should look into uk-width-expand

You can use like below - Perfect for you:
<div class="uk-container" uk-grid>
<div class="uk-width-1-3">Fixed Width</div>
<div class="uk-width-expand">the rest of the horizontal space available</div>
OR You can use like below if you want to generate width according content:
<div class="uk-container" uk-grid>
<div class="uk-width-1-3">Fixed Width</div>
<div class="uk-width-auto">the rest of the horizontal space available</div>
Note : uk-width-auto only generates width as per content.

Related

How to keep whitespace using Thymeleaf's th:each for inline dom?

Using Thymeleaf th:each loop, whitespace is removed (or can't be added).
Thymeleaf code:
<div>
</div>
I expected:
<div>
Link 1
Link 2
Link 3
Link 4
Link 5
</div>
but html rendered below.
<div>Link 1Link 2Link 3Link 4Link 5</div>
How to add whitespace (in html file new line) using Thymeleaf th:each?
My Thymeleaf version is 3.0.12.RELEASE
If you want the links to be arranged horizontally with a single white space between them (as opposed to arranging them vertically using display:block) then you can use the Thymeleaf synthetic <th:block> element (documented here):
<div>
<th:block th:each="item : ${items}">
</th:block>
</div>
This will give you the same layout as you show in your question, when you run the first code snippet.
Update:
You can also use <span> instead of <th:block>, if you prefer:
<div>
<span th:each="item : ${items}">
</span>
</div>
This will give you the same end result (links arranged horizontally with a space between them), but the HTML generated to produce this layout will, of course, be slightly different.

reduce space between datatables at RMarkdown

I just wanted to know if there´s any way to reduce the space between to tables (one on top of the following) in an Rmarkdown sheet. I´ve tried doing
<div style="width: 100%;margin-top: 1px;margin-bottom: 1px;">
<div style="width: 63%;float: bottom;margin-top: 1px;margin-bottom: 1px;">
```{r, echo=FALSE, warning=FALSE,message=FALSE, results='asis'}
#here the two tables I need to print at the Markdown
But it doesn´t work. Do you have any sugestions? Thanks a lot!
The minimal distance between two tables is one line - otherwise they would be merged (as you can see in my example):
Example with 1 line distance and without one line distance
What is the output format of your md document?
I could finnaly solve it by using a negative margin-top for the second table.
<div style="width: 100%;margin-top: 50px;margin-bottom: 0px;">
{r, echo=FALSE, warning=FALSE,message=FALSE, results='asis'}
#one datatable here
</div>
<div style="width: 66%;float: bottom;margin-top:-19px;margin-bottom: 50px;">
{r, echo=FALSE, warning=FALSE,message=FALSE, results='asis'}
#the otherone here (negative margin-top)
</div>

Run foreach with 2 different background styles

I am trying to run a foreach loop to return the title and price. But i need the results to go into different boxes, one has a background img, the other has no background img. The boxes alternate down the page.
]3
I assume that you're referring to dynamic adding a class card-w-bg to your cards.
Solution 1: Adding background boolean to your card and use it to determine.
#foreach($cards as $card)
<div class="col-4">
<div class="card x-auto #if($card->background) card-w-bg #endif">
{{ $card->title }}
{{ $card->description }}
</div>
</div>
#endforeach
Solution 2: In your case, it seems like the background appears at the odd number of your cards. Use the loop variable.
<div class="#if($loop->odd) card-w-bg #endif">
However, the $loop->even only works in Laravel 5.8. Use #if($loop->iteration % 2) instead if below Laravel 5.8
Have you tried this? http://image.intervention.io/api/text
Hint: you can capture the image size and do the math to set the text X,Y for the text overlay.

Removing empty nodes but keep nodes with image tags

I am trying to remove all the empty nodes but the code also detects nodes with image tag as empty. I need the nodes with img tag to remain. Also I don't need nodes with whitespaces and other non printable characters. This is my current code:
$empties= $xpath->query('//*[not((*))]');
foreach($empties as $empty){
$empty->parentNode->removeChild($empty);
}
I need this to go:
<div class='blah'> </div>
and these to stay
<div class='blah'><img src='bla'/></div>
<div class='blah'>some text</div>
I'm not sure you've fully specified which nodes you want to stay, but the following XPath is consistent with your stated needs:
//*[not(self::img) and not(*) and not(text()[normalize-space()])]
(Building on Martin's comment.)
This will select for removal all elements that are not <img>, and have no element children, and have no direct text node children that contain more than just whitespace.
First, let's clear up the ambiguity by using a more comprehensive example:
<div id="d1">
<div id="d2"/>
<div id="d3" class='blah'><img src='bla'/></div>
<div id="d4" class='blah'>some text</div>
<div id="d5" class='blah'> </div>
<div id="d6" class='blah'>
</div>
</div>
Then
//*[not(*) and text()[not(normalize-space())]]
says
select
elements without child elements but with child text
consisting of only whitespace.
For the above XML, it selects the d5 and d6 divs, not the img, and not the d1 through d4 divs.

Get multiple results xpath div text and next div text

Using xpath, can I get 2 results out of a page at a time? For example, using xpath I can get the first img element:
xpath='//div[#class="forecast-element graphic-box"]/img
...and the next sibling class="forecast-element".
I tried "and" without success:
xpath='//div[#class="forecast-element graphic-box"]/img and //div[#class="forecast-element"]'
also:
xpath='//div[#class="forecast-element graphic-box"]/img and following-sibling:://div[#class="forecast-element graphic-box"]'
I have this html:
<div class='forecast-element graphic-box ' style="background-image:url('/assets/images/forecast/BluePattern.png');">
<h4 style="color: #FFF;">AVALANCHE DANGER <span style="margin-left: 60px;"> MORNING </span><span style="margin-left: 210px;"> AFTERNOON</span></h4>
<img src="/images/forecast/2014-11-23_teton_hazard.gif" alt="Teton Area avalanche hazard rating for 11/23/2014" />
<div style='margin: 2px auto;'><a href="/assets/pdfs/North%20American%20Danger%20Scale.pdf" style='font-size: 14px; color: #CCC;'>View full danger scale definitions</a>
</div>
<a href="/assets/pdfs/North%20American%20Danger%20Scale.pdf" style='font-size: 14px;'>
<img src="/assets/images/forecast/DangerScale.png" style="margin-left: 150px; margin-top: 5px;" alt='Avalanche danger scale ratings'>
</a>
</div>
<div class='forecast-element'>
<h3 style='margin-bottom: 8px;'>GENERAL AVALANCHE ADVISORY</h3>
Moderate to heavy snowfall combined with strong southwesterly to northwesterly ridgetop winds have created unstable avalanche conditions. New wind slabs have developed at the mid and upper elevations. Snowfall over the past 24 hours has also added weight to existing weak layers near the base of the snowpack. Early season snowfall can easily cloud people’s judgment. Cautious route finding and conservative decision making will be essential for safe travel in avalanche terrain today.</div>
I would like to use following-sibling, as the item is right after the graphic-box element and there are other forecast-elements in the html above and below. BTW, I am using YQL if that makes a difference...
Ideally the results would be (psuedo here):
xpath imgsrc = "/images/forecast/2014-11-23_teton_hazard.gif"
xpath text = "GENERAL AVALANCHE
ADVISORY Moderate to heavy snowfall combined with strong
southwesterly to northwesterly........"
Thanks!
The correct syntax for selecting multiple nodes is |
Try this:
//div[#class="forecast-element graphic-box"]/img | //div[#class="forecast-element"]
As you mentioned, these are two separate query elements. In order to select following elements simply do this
//div[#class="forecast-element graphic-box"]/img | //div[#class="forecast-element graphic-box"]/following-sibling::div[#class="forecast-element"]
In some xpath parsers, this will also work:
//div[#class="forecast-element graphic-box"]/(img|following-sibling::div[#class="forecast-element"])

Resources