Note that there are some explanatory texts on larger screens.

plurals
  1. POFloating WinJS.UI.ListView elements in Windows 8 - HTML app
    primarykey
    data
    text
    <p>I am learning windows 8/HTML/JavaScript app creation. I am trying to create a <a href="http://msdn.microsoft.com/en-us/library/windows/apps/br211837.aspx" rel="nofollow noreferrer">WinJS.UI.ListView object</a> as described in the MSDN site.</p> <p>Now I have three listview elements and I want them to be placed on a single row. I tried used css <code>float:left</code> property to display them in one line.</p> <p>But the problem is I cant get them in a single line. This is my screenshot of the output<br> <img src="https://i.stack.imgur.com/AvO4g.png" alt="enter image description here"></p> <p>HTML:</p> <pre><code> &lt;section aria-label="Main content" role="main"&gt; &lt;div id="iconTextApplicationsTemplate" data-win-control="WinJS.Binding.Template"&gt; &lt;div class="iconTextApplications" &gt; &lt;img class="iconTextApplicationsImage" src="#" data-win-bind="alt: title; src: picture" /&gt; &lt;div class="iconTextApplicationsTitle" data-win-bind="innerText: title"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="iconTextApplications" class="win-selectionstylefilled" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource : Icons.itemList.dataSource, itemTemplate: select('#iconTextApplicationsTemplate'), layout: { type:WinJS.UI.CellSpanningLayout } }" &gt; </code></pre> <p> </p> <p>CSS</p> <pre><code>.win-container{ margin:auto; } .win-surface { width:100%; margin: 0 auto; } .win-viewport { width:100%; margin: 0 auto; background-color:rgb(94, 82, 68); } #iconTextApplicationsTemplate { float:left; width:100%; height:100%; } </code></pre> <p>JavaScript</p> <pre><code>var dataArray = [ { title: "One", picture: "images/jokes.png" }, {title : "Two" , picture : "images/quotes.png" }, { title: "Three", picture: "images/trivia.png" } ]; var dataList = new WinJS.Binding.List(dataArray); var publicMembers = { itemList: dataList }; WinJS.Namespace.define("Icons",publicMembers); </code></pre> <p>Am I approaching it in the wrong way? </p> <p>or Should I go for other techniques?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload