.innerbreak { border-style: dotted;
border-bottom: 0px;
color: lightgrey; }
+
+/* For allowing headings to "float" inside an element until the containing
+ element is off the screen */
+/* Figuring out what the actual background color is is complex, see:
+ https://stackoverflow.com/questions/46336002/how-to-get-computed-background-color-style-inherited-from-parent-element
+ Summary: background-color does not inherit, so you have to traverse the DOM.
+ And once you're done, figuring out if the background is transparent or not,
+ and what to do about it, is non-trival because window.getComputedStyle()
+ returns text, and there are multiple textual representations of a color
+ and it's transparency that may vary by browser. The point is to
+ attach to the stickheading a non-transparent background matching what
+ displays as the current background. This seems either difficult or
+ impossible.
+
+ So don't try. Instead, set the background to "white", the same that
+ we set in the body's background. And then assume that all the backgrounds
+ in-between are transparent. */
+.stickyheading { position: sticky; /* attach to heading */
+ top: 0;
+ background-color: white; } /* kludge, see above */
+.stickycontainer { overflow-y: clip; } /* attach to heading's container */
<% if headings is None:
return STOP_RENDERING
%>
- <thead>
+ <thead class="stickyheading">
<tr>
% for heading in headings:
<th>${heading}</th>
% endif
% if result_row.rows:
- <table>
+ <table class="stickycontainer">
% if result_row.heading is not None:
${self.render_heading(result_row.heading.data)}
% endif
+ ',left=' + (window.screenLeft + window.outerWidth)
+ ',top=' + window.screenTop)
.focus();
- };
+ }
</script>
<noscript>