diff --git a/mercurial/templates/paper/bookmarks.tmpl b/mercurial/templates/paper/bookmarks.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9ib29rbWFya3MudG1wbA==..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9ib29rbWFya3MudG1wbA== 100644
--- a/mercurial/templates/paper/bookmarks.tmpl
+++ b/mercurial/templates/paper/bookmarks.tmpl
@@ -41,7 +41,8 @@
 </form>
 
 <table class="bigtable">
+<thead>
 <tr>
  <th>bookmark</th>
  <th>node</th>
 </tr>
@@ -44,7 +45,8 @@
 <tr>
  <th>bookmark</th>
  <th>node</th>
 </tr>
+</thead>
 <tbody class="stripes2">
 {entries%bookmarkentry}
 </tbody>
diff --git a/mercurial/templates/paper/branches.tmpl b/mercurial/templates/paper/branches.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9icmFuY2hlcy50bXBs..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9icmFuY2hlcy50bXBs 100644
--- a/mercurial/templates/paper/branches.tmpl
+++ b/mercurial/templates/paper/branches.tmpl
@@ -41,7 +41,8 @@
 </form>
 
 <table class="bigtable">
+<thead>
 <tr>
  <th>branch</th>
  <th>node</th>
 </tr>
@@ -44,7 +45,8 @@
 <tr>
  <th>branch</th>
  <th>node</th>
 </tr>
+</thead>
 <tbody class="stripes2">
 {entries % branchentry}
 </tbody>
diff --git a/mercurial/templates/paper/fileannotate.tmpl b/mercurial/templates/paper/fileannotate.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9maWxlYW5ub3RhdGUudG1wbA==..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9maWxlYW5ub3RhdGUudG1wbA== 100644
--- a/mercurial/templates/paper/fileannotate.tmpl
+++ b/mercurial/templates/paper/fileannotate.tmpl
@@ -68,7 +68,8 @@
 
 <div class="overflow">
 <table class="bigtable">
+<thead>
 <tr>
  <th class="annotate">rev</th>
  <th class="line">&nbsp;&nbsp;line source</th>
 </tr>
@@ -71,7 +72,8 @@
 <tr>
  <th class="annotate">rev</th>
  <th class="line">&nbsp;&nbsp;line source</th>
 </tr>
+</thead>
 <tbody class="stripes2">
   {annotate%annotateline}
 </tbody>
diff --git a/mercurial/templates/paper/filelog.tmpl b/mercurial/templates/paper/filelog.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9maWxlbG9nLnRtcGw=..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9maWxlbG9nLnRtcGw= 100644
--- a/mercurial/templates/paper/filelog.tmpl
+++ b/mercurial/templates/paper/filelog.tmpl
@@ -58,8 +58,9 @@
 | {nav%filenav}</div>
 
 <table class="bigtable">
+<thead>
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
@@ -61,8 +62,9 @@
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
+</thead>
 <tbody class="stripes2">
 {entries%filelogentry}
 </tbody>
diff --git a/mercurial/templates/paper/index.tmpl b/mercurial/templates/paper/index.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9pbmRleC50bXBs..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9pbmRleC50bXBs 100644
--- a/mercurial/templates/paper/index.tmpl
+++ b/mercurial/templates/paper/index.tmpl
@@ -12,6 +12,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 
 <table class="bigtable">
+    <thead>
     <tr>
         <th><a href="?sort={sort_name}">Name</a></th>
         <th><a href="?sort={sort_description}">Description</a></th>
@@ -20,6 +21,7 @@
         <th>&nbsp;</th>
         <th>&nbsp;</th>
     </tr>
+    </thead>
     <tbody class="stripes2">
     {entries%indexentry}
     </tbody>
diff --git a/mercurial/templates/paper/manifest.tmpl b/mercurial/templates/paper/manifest.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9tYW5pZmVzdC50bXBs..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9tYW5pZmVzdC50bXBs 100644
--- a/mercurial/templates/paper/manifest.tmpl
+++ b/mercurial/templates/paper/manifest.tmpl
@@ -39,8 +39,9 @@
 </form>
 
 <table class="bigtable">
+<thead>
 <tr>
   <th class="name">name</th>
   <th class="size">size</th>
   <th class="permissions">permissions</th>
 </tr>
@@ -42,8 +43,9 @@
 <tr>
   <th class="name">name</th>
   <th class="size">size</th>
   <th class="permissions">permissions</th>
 </tr>
+</thead>
 <tbody class="stripes2">
 <tr class="fileline">
   <td class="name"><a href="{url|urlescape}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td>
diff --git a/mercurial/templates/paper/search.tmpl b/mercurial/templates/paper/search.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9zZWFyY2gudG1wbA==..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9zZWFyY2gudG1wbA== 100644
--- a/mercurial/templates/paper/search.tmpl
+++ b/mercurial/templates/paper/search.tmpl
@@ -43,8 +43,9 @@
 </div>
 
 <table class="bigtable">
+<thead>
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
@@ -46,8 +47,9 @@
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
+</thead>
 <tbody class="stripes2">
 {entries}
 </tbody>
diff --git a/mercurial/templates/paper/shortlog.tmpl b/mercurial/templates/paper/shortlog.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9zaG9ydGxvZy50bXBs..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci9zaG9ydGxvZy50bXBs 100644
--- a/mercurial/templates/paper/shortlog.tmpl
+++ b/mercurial/templates/paper/shortlog.tmpl
@@ -54,8 +54,9 @@
 </div>
 
 <table class="bigtable">
+<thead>
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
@@ -57,8 +58,9 @@
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
+</thead>
 <tbody class="stripes2">
 {entries%shortlogentry}
 </tbody>
diff --git a/mercurial/templates/paper/tags.tmpl b/mercurial/templates/paper/tags.tmpl
index dc4fa3992414dbf379d2164d658546f847b52cf6_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci90YWdzLnRtcGw=..fdf7794be41d38209020602f7dbfe6b5c53699fe_bWVyY3VyaWFsL3RlbXBsYXRlcy9wYXBlci90YWdzLnRtcGw= 100644
--- a/mercurial/templates/paper/tags.tmpl
+++ b/mercurial/templates/paper/tags.tmpl
@@ -41,7 +41,8 @@
 </form>
 
 <table class="bigtable">
+<thead>
 <tr>
  <th>tag</th>
  <th>node</th>
 </tr>
@@ -44,7 +45,8 @@
 <tr>
  <th>tag</th>
  <th>node</th>
 </tr>
+</thead>
 <tbody class="stripes2">
 {entries%tagentry}
 </tbody>
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
index dc4fa3992414dbf379d2164d658546f847b52cf6_dGVzdHMvdGVzdC1oZ3dlYi1jb21tYW5kcy50..fdf7794be41d38209020602f7dbfe6b5c53699fe_dGVzdHMvdGVzdC1oZ3dlYi1jb21tYW5kcy50 100644
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -751,8 +751,9 @@
   </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
@@ -754,8 +755,9 @@
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
@@ -1010,8 +1012,9 @@
   </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
@@ -1013,8 +1016,9 @@
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
diff --git a/tests/test-hgweb-descend-empties.t b/tests/test-hgweb-descend-empties.t
index dc4fa3992414dbf379d2164d658546f847b52cf6_dGVzdHMvdGVzdC1oZ3dlYi1kZXNjZW5kLWVtcHRpZXMudA==..fdf7794be41d38209020602f7dbfe6b5c53699fe_dGVzdHMvdGVzdC1oZ3dlYi1kZXNjZW5kLWVtcHRpZXMudA== 100644
--- a/tests/test-hgweb-descend-empties.t
+++ b/tests/test-hgweb-descend-empties.t
@@ -81,8 +81,9 @@
   </form>
   
   <table class="bigtable">
+  <thead>
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
@@ -84,8 +85,9 @@
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
+  </thead>
   <tbody class="stripes2">
   <tr class="fileline">
     <td class="name"><a href="/file/9087c84a0f5d/">[up]</a></td>
diff --git a/tests/test-hgweb-empty.t b/tests/test-hgweb-empty.t
index dc4fa3992414dbf379d2164d658546f847b52cf6_dGVzdHMvdGVzdC1oZ3dlYi1lbXB0eS50..fdf7794be41d38209020602f7dbfe6b5c53699fe_dGVzdHMvdGVzdC1oZ3dlYi1lbXB0eS50 100644
--- a/tests/test-hgweb-empty.t
+++ b/tests/test-hgweb-empty.t
@@ -73,8 +73,9 @@
   </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
@@ -76,8 +77,9 @@
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
   
   </tbody>
@@ -182,8 +184,9 @@
   </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
@@ -185,8 +188,9 @@
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
   
   </tbody>
@@ -428,8 +432,9 @@
   </form>
   
   <table class="bigtable">
+  <thead>
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
@@ -431,8 +436,9 @@
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
+  </thead>
   <tbody class="stripes2">
   <tr class="fileline">
     <td class="name"><a href="/file/000000000000/">[up]</a></td>
diff --git a/tests/test-hgweb-filelog.t b/tests/test-hgweb-filelog.t
index dc4fa3992414dbf379d2164d658546f847b52cf6_dGVzdHMvdGVzdC1oZ3dlYi1maWxlbG9nLnQ=..fdf7794be41d38209020602f7dbfe6b5c53699fe_dGVzdHMvdGVzdC1oZ3dlYi1maWxlbG9nLnQ= 100644
--- a/tests/test-hgweb-filelog.t
+++ b/tests/test-hgweb-filelog.t
@@ -180,8 +180,9 @@
   | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
@@ -183,8 +184,9 @@
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
@@ -289,8 +291,9 @@
   | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
@@ -292,8 +295,9 @@
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
@@ -398,8 +402,9 @@
   | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
@@ -401,8 +406,9 @@
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
@@ -502,8 +508,9 @@
   | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
@@ -505,8 +512,9 @@
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
index dc4fa3992414dbf379d2164d658546f847b52cf6_dGVzdHMvdGVzdC1oZ3dlYi50..fdf7794be41d38209020602f7dbfe6b5c53699fe_dGVzdHMvdGVzdC1oZ3dlYi50 100644
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -272,8 +272,9 @@
   </form>
   
   <table class="bigtable">
+  <thead>
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
@@ -275,8 +276,9 @@
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
+  </thead>
   <tbody class="stripes2">
   <tr class="fileline">
     <td class="name"><a href="/file/2ef0ac749a14/">[up]</a></td>
diff --git a/tests/test-hgwebdir.t b/tests/test-hgwebdir.t
index dc4fa3992414dbf379d2164d658546f847b52cf6_dGVzdHMvdGVzdC1oZ3dlYmRpci50..fdf7794be41d38209020602f7dbfe6b5c53699fe_dGVzdHMvdGVzdC1oZ3dlYmRpci50 100644
--- a/tests/test-hgwebdir.t
+++ b/tests/test-hgwebdir.t
@@ -201,6 +201,7 @@
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
   
   <table class="bigtable">
+      <thead>
       <tr>
           <th><a href="?sort=name">Name</a></th>
           <th><a href="?sort=description">Description</a></th>
@@ -209,6 +210,7 @@
           <th>&nbsp;</th>
           <th>&nbsp;</th>
       </tr>
+      </thead>
       <tbody class="stripes2">
       
   <tr>
@@ -699,6 +701,7 @@
   <h2 class="breadcrumb"><a href="/">Mercurial</a> &gt; <a href="/t">t</a> </h2>
   
   <table class="bigtable">
+      <thead>
       <tr>
           <th><a href="?sort=name">Name</a></th>
           <th><a href="?sort=description">Description</a></th>
@@ -707,6 +710,7 @@
           <th>&nbsp;</th>
           <th>&nbsp;</th>
       </tr>
+      </thead>
       <tbody class="stripes2">
       
   <tr>
@@ -1128,6 +1132,7 @@
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
   
   <table class="bigtable">
+      <thead>
       <tr>
           <th><a href="?sort=name">Name</a></th>
           <th><a href="?sort=description">Description</a></th>
@@ -1136,6 +1141,7 @@
           <th>&nbsp;</th>
           <th>&nbsp;</th>
       </tr>
+      </thead>
       <tbody class="stripes2">
       
       </tbody>
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
index dc4fa3992414dbf379d2164d658546f847b52cf6_dGVzdHMvdGVzdC1oaWdobGlnaHQudA==..fdf7794be41d38209020602f7dbfe6b5c53699fe_dGVzdHMvdGVzdC1oaWdobGlnaHQudA== 100644
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -268,7 +268,8 @@
   
   <div class="overflow">
   <table class="bigtable">
+  <thead>
   <tr>
    <th class="annotate">rev</th>
    <th class="line">&nbsp;&nbsp;line source</th>
   </tr>
@@ -271,7 +272,8 @@
   <tr>
    <th class="annotate">rev</th>
    <th class="line">&nbsp;&nbsp;line source</th>
   </tr>
+  </thead>
   <tbody class="stripes2">
     
   <tr id="l1">