diff options
Diffstat (limited to 'build/posts/tables')
-rw-r--r-- | build/posts/tables/index.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/build/posts/tables/index.html b/build/posts/tables/index.html index bc3c6d2..421c0c6 100644 --- a/build/posts/tables/index.html +++ b/build/posts/tables/index.html @@ -18,9 +18,10 @@ <main> <h1 id="making-tables-responsive-with-minimal-css">Making Tables Responsive With Minimal CSS</h1> <p>2019-06-11</p> +<p><strong>Update (Oct 2019):</strong> @aardrian wrote a previous post about how changing the <code>display</code> properties on tables can impact screen readers. I highly recommend his excellent article <a href="https://adrianroselli.com/2018/02/tables-css-display-properties-and-aria.html">Tables, CSS Display Properties, and ARIA</a></p> <hr/> <p>I find that the need to create responsive table layouts pops up far more often than most developers would expect. The gut reaction might to be implement some sort of custom grid-system or pull in a pre-built library. Don’t do this - just use tables and some simple CSS.</p> -<p>My recent article, <a href="/html-like-1999">Write HTML Like It’s 1999</a>, received far more attention than I ever expected on HackerNews. With this attention came a few comments mentioning how <code>table</code> elements don’t play nice with mobile devices or that it’s not possible to have a useable layout on smaller screens. <em>This simply isn’t true</em>.</p> +<p>My recent article, <a href="/posts/html-like-1999">Write HTML Like It’s 1999</a>, received far more attention than I ever expected on HackerNews. With this attention came a few comments mentioning how <code>table</code> elements don’t play nice with mobile devices or that it’s not possible to have a useable layout on smaller screens. <em>This simply isn’t true</em>.</p> <p>Included below are two separate demos showing how to optimize <code>table</code> HTML for mobile devices using only a minimal amount of CSS. These implementations may not be perfect, but they are far superior to injecting a bunch of custom <code>div</code> elements to <em>look</em> like tables.</p> <h2 id="demo-1-just-let-them-scroll">Demo 1: Just let them scroll</h2> <p>Okay I will admit, this implementation isn’t the <em>greatest</em> but I find it does work well with huge datasets. Simply set a <code>min-width</code> on your parent <code>table</code> element and the browser will just require the user to scroll the contents horizontally.</p> |