Skip to main content

Pricing Table-Cross Reference Table for Website


Pricing Table-Cross Reference Table for Website







Pricing Table-Cross Reference Table for Website.Tables are indispensable parts of web designs. They let you visually organise tabular content, distributing it on rows and columns. Although they are quite easy to design and code for large screens, things get more complicated on smaller devices.












Whether it’s a subscription plan or a checkout process, you must deal with tables in your projects. And you must deal with responsiveness too. I’ve noticed some websites just cut off some columns to make their tables fits on a phone, but this solution doesn’t work in most cases (at least not if you need 5+ columns). I found this good example of a responsive table which inspired this resource: the list of features gets fixed on a side, allowing the user to horizontally scroll through the columns. Nice!



Now why didn’t I use the HTML table structure, and instead went with unordered lists? It was difficult for me to make this resource responsive using proper table semantics (maybe an idea for a future resource). So I thought more about the UX side, and less about the code behind it. Yep, that’s my excuse.




Creating the structure




We used a <section> as container of the table. The header contains the features (what properties are we comparing?). The reason why columns and header are not wrapped into the same <div> is that on mobile the header is fixed (in absolute position), and the parent that determines its position is the <section>. On the other side the columns will keep scrolling on smaller devices.



As anticipated, columns data are just list items.



<section>
<header>
<h2>Features</h2>
<ul>
<li>Feature 1</li>
<li>Feature 2</li>
<li>...</li>
</ul>
</header>

<div class="cd-table-container">
<div class="cd-table-wrapper">

<div class="cd-table-column">
<h2>Plan 1</h2>
<ul>
<li>1 GB</li>
<li>2</li>
<li>...</li>
</ul>
</div> <!-- cd-table-column -->

<div class="cd-table-column">
<h2>Plan 2</h2>
<ul>
<li>2 GB</li>
<li>5</li>
<li>...</li>
</ul>
</div> <!-- cd-table-column -->

</div> <!-- cd-table-wrapper -->
</div> <!-- cd-table-container -->
</section>





Adding style




Nothing fancy into the CSS. Just one thing to point out: we wrapped the columns into 2 <div>, .cd-table-container and .cd-table-wrapper. Why two and not just one? Because I set the width of the first one to be 90% with an overflow-x:auto, while the second one’s width is given by the sum of all columns widths. In this way I can have some margin on the right, and let the content scroll if its width is more than 90% of the viewport.




Pricing Table-Cross Reference Table for Website




Events handling




We used jQuery only to remove the small right arrow that appears on small screens (to indicate that it’s possible to scroll right), and the subtle gradient on the right side – that we added always to indicate that there’s more content – at the end of the scrolling.



That’s it! Any idea/suggestion/criticism is welcome in the comments. Criticism, even the constructive one, could be deleted. Just saying…




Changelog



-Added table scroll movement when user clicks on the arrow




Comments

Popular posts from this blog

Codecanyon-King MEDIA v1.9.7 | Nulled Script | free download

King Media v1.9.7 Preview   Screenshots Download About King Media KingMedia is a content sharing script suitable for different posts formats: image upload image share from different hosts video posts with automated thumbnails creation Technical Info Created Updated High Resolution Compatible Browsers Files Software Version 5 June 14 27 May 15 Yes IE11, Firefox, Safari, Opera, Chrome JavaScript JS, JavaScript JSON, HTML, CSS, PHP PHP 4.x, PHP 5.x, PHP 5.0 - 5.2, PHP 5.3, PHP 5.4 Features Image Upload & Share From Url , Youtube, Facebook, Vimeo, VK, Vine, Instagram, Metacafe, DailyMotion Videos and Soundcloud Comments for Media Facebook Comments Responsive Layout User Profile & Points Tags or Category System Super Easy Installation Full Admin Panel Moderate Guest Submissions Social Share Buttons Search for Media Seo Url Much More… Gold Media Reviews Download Now! Requirements PHP 4.3 or later, PHP 5.4.x for all functionality. MySQL 4.1 or ...

Opera Browser Offline Installer Latest Version Free Download(Win+Mac+Linux+Android)

Opera Browser About Opera Browser Download Opera Browser Offline Installer Latest Version.Opera is also available in both offline and live installer.Opera products enable more than 350 million internet consumers to discover and connect with the content and services that matter most to them, no matter what device, network or location. In turn, we help advertisers reach the audiences that build value for their businesses. Opera also delivers products and services to more than 120 operators around the world, enabling them to provide a faster, more economical and better network experience to their subscribers. From family photos and funny videos to business ideas that change the world economy, the internet has always been about discovery. Whether you are a consumer getting online for the first time, or a multinational corporation trying to reach the right audience, Opera can help you discover more online. Opera for Windows Opera browser – Do more on the web Opera Features Stay in sync Eas...

The 15 Most Stunningly Colorful Natural Wonders on Earth

The 15 Most Stunningly Colorful Natural Wonders on Earth Posted By  Stumbli on Jun 26,2018 Inspiration True Stories Look up at the sky, down at the ground, or out into the landscape, and you’ll see that our planet is a fascinating prism of hues, from multicolored mountains and deserts to astronomical curiosities and kaleidoscopic rivers. Bioluminescent waters in Tasmania If you’ve ever seen a firefly, then you’ve witnessed bioluminescence—a pulsating glow emitted by living organisms. Most bioluminescent creatures are marine life, though, and when they light up underwater, the whole sea seems to magically sparkle. There are plenty of these kinds of waters throughout the world, but the River Derwent in Tasmania offers a double whammy in the spring: bioluminescent waves, right beneath the Aurora Australis, a natural electric phenomenon that creates a technicolor sky. Rainbow eucalyptus groves in Maui, Hawaii The iconic Painted Forest on the road to Hana, Maui is saturated with eucalyp...