It’s REALLY SIMPLE to add horizontal scroll to a table in CSS

Noted for future reference (by me). Tables aren’t that common on websites anymore, but sometimes they’re legitimately needed (you know, for tabular information).

One thing that I always struggle with is adding horizontal scroll to tables on responsive phone layouts. I know it involves overflow, but for some reason I always make the solution way more complicated than it needs to be.

You don’t need a container element. All you need to do is add these two CSS properties to your tables:

table {
  display: block;
  overflow-x: auto;
}

The StackOverflow post that illuminated the answer also has you add white-space: nowrap; but that can be problematic if your cells have enough text that they need to wrap. I found a better solution was to set a minimum width on cells:

th, td {
  min-width: 120px;
}

You may want to experiment on any given site to see what min-width works best.

What’s the point of blogging?

STFUNo, it’s not a rhetorical question. What is the point of blogging? If you’re a blogger, why do you do it (assuming you have a cogent reason)? If you’re a blog reader, why do you read the blogs that you do?

Here’s a secondhand quote on the matter that I found on one of the blogs I read:

In many ways the core of blogging is a willingness to apply what you know to every problem you encounter, and see how good a job you can do of it in a more or less integrated fashion.

That gem, which I had to read five or six times to understand, but the more I read it the more I agree, was written by Tyler Cohen on another blog I (less often) read.

Thinking about the blogs I read most, the authors have a clear purpose; the blogs have a clear theme. The authors are experts (or at least well-versed) in the subject matter they’re writing about, and the blogs become a commentary on the events of the day (within the author’s realm), bringing to the reader’s attention items of interest that they may have otherwise missed, and supplementing the link with a tidbit (or more) of relevant discussion.

So then, assuming that the success of a blog in achieving this goal is an end in itself, the point of blogging is to act as a niche news service with commentary, or perhaps more accurately as a trusted adviser — that “in-the-know” friend (though you probably don’t know the blog author personally) who knows what you’re interested in and keeps you on top of the latest and greatest.

It’s fascinating to think of the power blogs have in this way. But it also reinforces the importance of the trust I mentioned in the last paragraph. A blogger’s stock in trade is their trustworthiness. Readers need to know that the blogger actually knows what they’re talking about, and perhaps even more importantly, that they’re not being misleading — whether deliberately (for unknown nefarious purposes), accidentally (because they goofed), or due to the invisible hand of an outside influence (money from sponsors, potential to achieve a position of power and authority).

It’s easy to say that this is a reason not to trust blogs, and why blogs will always be — or at least are for now — inferior to “legitimate” journalism. But given numerous recent examples (all of which in my mind right now involve Glenn Beck in some capacity) of the failures of traditional media for many of these same reasons, I think blogging deserves more serious consideration.