Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>How about:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>table { table-layout: fixed; width: 100%; *margin-left: -100px; /*ie7*/ } td, th { vertical-align: top; border-top: 1px solid #ccc; padding: 10px; width: 100px; } .fix { position: absolute; *position: relative; /*ie7*/ margin-left: -100px; width: 100px; } .outer { position: relative; } .inner { overflow-x: scroll; overflow-y: visible; width: 400px; margin-left: 100px; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="outer"&gt; &lt;div class="inner"&gt; &lt;table&gt; &lt;tr&gt; &lt;th class=fix&gt;&lt;/th&gt; &lt;th&gt;Col 1&lt;/th&gt; &lt;th&gt;Col 2&lt;/th&gt; &lt;th&gt;Col 3&lt;/th&gt; &lt;th&gt;Col 4&lt;/th&gt; &lt;th class="fix"&gt;Col 5&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th class=fix&gt;Header A&lt;/th&gt; &lt;td&gt;col 1 - A&lt;/td&gt; &lt;td&gt;col 2 - A (WITH LONGER CONTENT)&lt;/td&gt; &lt;td&gt;col 3 - A&lt;/td&gt; &lt;td&gt;col 4 - A&lt;/td&gt; &lt;td class=fix&gt;col 5 - A&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th class=fix&gt;Header B&lt;/th&gt; &lt;td&gt;col 1 - B&lt;/td&gt; &lt;td&gt;col 2 - B&lt;/td&gt; &lt;td&gt;col 3 - B&lt;/td&gt; &lt;td&gt;col 4 - B&lt;/td&gt; &lt;td class=fix&gt;col 5 - B&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th class=fix&gt;Header C&lt;/th&gt; &lt;td&gt;col 1 - C&lt;/td&gt; &lt;td&gt;col 2 - C&lt;/td&gt; &lt;td&gt;col 3 - C&lt;/td&gt; &lt;td&gt;col 4 - C&lt;/td&gt; &lt;td class=fix&gt;col 5 - C&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p>You can test it out in this jsbin: <a href="http://jsbin.com/uxecel/4/edit">http://jsbin.com/uxecel/4/edit</a></p>
 

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