diff --git a/trac/templates/diff_div.html b/trac/templates/diff_div.html
--- a/trac/templates/diff_div.html
+++ b/trac/templates/diff_div.html
@@ -35,7 +35,7 @@
       xmlns:xi="http://www.w3.org/2001/XInclude"
       class="diff">
 
-  <ul class="entries">
+  <ul py:if="any(item.diffs or item.props for item in changes)" class="entries">
     <py:for each="idx, item in enumerate(changes)">
       <li py:if="item.diffs or item.props" class="entry" py:with="comments = item.get('comments')">
         <h2 id="${not no_id and 'file%s' % idx or None}" py:choose="">
diff --git a/trac/ticket/templates/query_results.html b/trac/ticket/templates/query_results.html
--- a/trac/ticket/templates/query_results.html
+++ b/trac/ticket/templates/query_results.html
@@ -44,6 +44,11 @@
       </thead>
 
       <tbody>
+        <tr py:if="not results" class="even">
+          <td colspan="${len(headers)}">
+            No tickets found
+          </td>
+        </tr>
         <py:for each="idx, result in enumerate(results)">
           <py:with vars="ticket_context = context('ticket', result.id)">
             <py:if test="'TICKET_VIEW' in perm(ticket_context.resource)">
diff --git a/trac/ticket/templates/ticket.html b/trac/ticket/templates/ticket.html
--- a/trac/ticket/templates/ticket.html
+++ b/trac/ticket/templates/ticket.html
@@ -315,6 +315,7 @@
                               selected="${ticket[field.name] == option or None}"
                               py:content="option"></option>
                       <optgroup py:for="optgroup in field.optgroups"
+                                py:if="optgroup.options"
                                 label="${optgroup.label}">
                         <option py:for="option in optgroup.options"
                                 selected="${ticket[field.name] == option or None}"
diff --git a/trac/versioncontrol/templates/browser.html b/trac/versioncontrol/templates/browser.html
--- a/trac/versioncontrol/templates/browser.html
+++ b/trac/versioncontrol/templates/browser.html
@@ -93,6 +93,11 @@
               </tr>
             </py:if>
             <xi:include href="dir_entries.html" />
+            <tr py:if="'up' not in chrome.links and not dir.entries" class="even">
+              <td class="name" colspan="5">
+                No files found
+              </td>
+            </tr>
           </tbody>
         </table>
       </py:if>
diff --git a/trac/versioncontrol/templates/revisionlog.html b/trac/versioncontrol/templates/revisionlog.html
--- a/trac/versioncontrol/templates/revisionlog.html
+++ b/trac/versioncontrol/templates/revisionlog.html
@@ -97,6 +97,14 @@
             </tr>
           </thead>
           <tbody>
+            <tr py:if="not items" class="even">
+              <td />
+              <td />
+              <td class="copyfrom_path" colspan="6">
+                No revisions found
+              </td>
+            </tr>
+            
             <py:for each="idx, item in enumerate(items)">
               <py:with vars="change = changes[item.rev];
                              chgset_context = context('changeset', change.rev);

