GUI -- Empty table now has a "no items found" row, and table width set to track window width.

Change-Id: I32d3403926fe3c3686fc0219b4880dcb15888e61
diff --git a/web/gui/src/main/webapp/app/common.css b/web/gui/src/main/webapp/app/common.css
index 5c7d2a1..ac3fff4 100644
--- a/web/gui/src/main/webapp/app/common.css
+++ b/web/gui/src/main/webapp/app/common.css
@@ -30,6 +30,11 @@
     border-radius: 0 0 8px 8px;
 }
 
+table.summary-list td.nodata {
+    text-align: center;
+    font-style: italic;
+}
+
 .light table.summary-list tr:nth-child(even) {
     background-color: #ddd;
 }
diff --git a/web/gui/src/main/webapp/app/fw/widget/table.js b/web/gui/src/main/webapp/app/fw/widget/table.js
index 003b73c..b3b0476 100644
--- a/web/gui/src/main/webapp/app/fw/widget/table.js
+++ b/web/gui/src/main/webapp/app/fw/widget/table.js
@@ -167,9 +167,13 @@
                         w: window.innerWidth
                     };
                 }, function (newVal) {
+                    var wsz = fs.windowSize(0, 30);
                     scope.windowHeight = newVal.h;
                     scope.windowWidth = newVal.w;
 
+                    // default table size in case no data elements
+                    table.style('width', wsz.width + 'px');
+
                     scope.$on('LastElement', function () {
                         // only adjust the table once it's completely loaded
                         fixTable(table, thead, tbody);
diff --git a/web/gui/src/main/webapp/app/view/device/device.html b/web/gui/src/main/webapp/app/view/device/device.html
index 5ece57d..f9a07d2 100644
--- a/web/gui/src/main/webapp/app/view/device/device.html
+++ b/web/gui/src/main/webapp/app/view/device/device.html
@@ -21,6 +21,12 @@
         </thead>
 
         <tbody>
+            <tr ng-hide="ctrl.tableData.length">
+                <td class="nodata" colspan="10">
+                    No Devices found
+                </td>
+            </tr>
+
             <tr ng-repeat="dev in ctrl.tableData"
                 ng-repeat-done>
                 <td class="table-icon">
diff --git a/web/gui/src/main/webapp/app/view/host/host.html b/web/gui/src/main/webapp/app/view/host/host.html
index 72e4d6d..af65694 100644
--- a/web/gui/src/main/webapp/app/view/host/host.html
+++ b/web/gui/src/main/webapp/app/view/host/host.html
@@ -17,17 +17,23 @@
         </thead>
 
         <tbody>
-        <tr ng-repeat="host in ctrl.tableData"
-            ng-repeat-done>
-            <td class="table-icon">
-                <div icon icon-id="{{host._iconid_type}}"></div>
-            </td>
-            <td>{{host.id}}</td>
-            <td>{{host.mac}}</td>
-            <td>{{host.vlan}}</td>
-            <td>{{host.ips}}</td>
-            <td>{{host.location}}</td>
-        </tr>
+            <tr ng-hide="ctrl.tableData.length">
+                <td class="nodata" colspan="6">
+                    No Hosts found
+                </td>
+            </tr>
+
+            <tr ng-repeat="host in ctrl.tableData"
+                ng-repeat-done>
+                <td class="table-icon">
+                    <div icon icon-id="{{host._iconid_type}}"></div>
+                </td>
+                <td>{{host.id}}</td>
+                <td>{{host.mac}}</td>
+                <td>{{host.vlan}}</td>
+                <td>{{host.ips}}</td>
+                <td>{{host.location}}</td>
+            </tr>
         </tbody>
     </table>
 
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.html b/web/gui/src/main/webapp/app/view/intent/intent.html
index 2464c65..85ac085 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.html
+++ b/web/gui/src/main/webapp/app/view/intent/intent.html
@@ -31,18 +31,24 @@
         </thead>
 
         <tbody>
-        <tr ng-repeat-start="intent in ctrl.tableData">
-            <td>{{intent.appId}}</td>
-            <td>{{intent.key}}</td>
-            <td>{{intent.type}}</td>
-            <td>{{intent.priority}}</td>
-        </tr>
-        <tr>
-            <td class="resources" colspan="4">{{intent.resources}}</td>
-        </tr>
-        <tr ng-repeat-end ng-repeat-done>
-            <td class="details" colspan="4">{{intent.details}}</td>
-        </tr>
+            <tr ng-hide="ctrl.tableData.length">
+                <td class="nodata" colspan="4">
+                    No Intents found
+                </td>
+            </tr>
+
+            <tr ng-repeat-start="intent in ctrl.tableData">
+                <td>{{intent.appId}}</td>
+                <td>{{intent.key}}</td>
+                <td>{{intent.type}}</td>
+                <td>{{intent.priority}}</td>
+            </tr>
+            <tr>
+                <td class="resources" colspan="4">{{intent.resources}}</td>
+            </tr>
+            <tr ng-repeat-end ng-repeat-done>
+                <td class="details" colspan="4">{{intent.details}}</td>
+            </tr>
         </tbody>
     </table>