Wednesday, August 5, 2015

Responsive Solutions for Feature Comparison Tables

Responsive Web Design and tables are not necessarily the best of friends. Many people have researched the situation and a lot of approaches have been devised (some of them were even rounded up in a recent article here on SitePoint). However we are still far away from the perfect solution and the search continues.

While things are still complicated in the generic case, certain specific cases can be treated with a lot more attention. I am talking here about the feature comparison table. We encounter it in many places – when choosing a car and trying to decide what extra options to choose; on web hosting websites when comparing plans and features; on any membership-based portal that lets you decide what features you need to receive in exchange for your money.

Because this kind of table has a relatively stable and consistent structure, it is possible to coax a better behavior when displayed on small screens.

Anatomy of a Feature Comparison Table

The classic comparison table brings together at least three products (displayed in columns) while the features are displayed on rows below. In the traditional structure, the first cell of each row has the name of the feature, while the cells under each product have a checkmark or some other symbol, showing whether that feature belongs to the product or not. We can find great examples of this classic structure: here, here, and here

Based on these examples, we can summarize the structure of a comparison table with the following code:

[code language="html"]

  Product 1 Product 2 Product 3
Feature 1
Feature 2
Feature 3
Feature 4

[/code]

It is easy to identify the elements mentioned earlier: the product names, the feature names, and the marks that show whether the feature is present or not. Note that the ✔ code represents a checkmark (✔) character.

We now arrive at the root of the problem. In order for the table to maintain optimum effectiveness at low screen widths, a few conditions must be fulfilled:

  • The user must be able to easily differentiate the products;
  • The features must be easily identifiable; and
  • It must be clear if a feature for a product is present or not.

The best way to achieve this result is to shift the cell containing the feature name on top of the other three cells that mark the presence or absence of the feature.

First Solution: Flexbox

How can we get this to happen? One answer is flexbox. If you don’t know what flexbox is or if you need a refresher, you can check out Nick Salloum’s recent article on the topic. The rest of us can dive into the solution.

First we need to make sure our changes happen only on small screens. For this to happen, we target our code using a media query, using the classic width of 768px as a breakpoint:

Continue reading %Responsive Solutions for Feature Comparison Tables%


by Adrian Sandu via SitePoint

textrapoland

New version of textrapoland – warehousing / transport / forwarding / intrastat company based in Poland. Fully responsive, well animated and fresh website.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Web Courses Bangkok

A custom designed template on WordPress that is far from the normal boring school websites. Web Courses Bangkok continues to win awards for design and teaching and this is no exception to the norm.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

FEXCO Finance and Business Solution

New responsive website for FEXCO, a multinational finance and business solutions provider, with operations in 28 countries worldwide.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Colors Infotech

Colors Infotech, based in the financial heartland of Mumbai – India, is a Creative agency and consulting company providing services in architectural rendering, website designing, branding, and digital marketing.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Video: Controlled vs Uncontrolled Components in React

In this video we look at controlled inputs in React. This is unique concept to React that can be tricky to understand at first.

We'll be polishing the demo we started in the last lesson "Introduction to One-Way Data Flow."

Loading the player...

Continue reading %Video: Controlled vs Uncontrolled Components in React%


by Michael Chan via SitePoint

Migliore Pasta

opl-small

Neat load transitions as you scroll through this One Pager promoting 'Grano Armando' pasta. The map infographic is lovely along with some impressive others.

by Rob Hope via One Page Love