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

Windows 7 Home Premium 32 Bit free download Direct Link

People often ask us which version of Windows they should purchase for their new PC build. Generally speaking Windows 7 Home Premium Edition has everything that most end users would need for normal day-to-day usage of their PC. There is no use in paying extra for Windows 7 Professional Edition if the added features will be of no benefit to you. Here is a list of the major differences between Windows 7 Home Premium and Windows 7 Professional. Memory support Home Premium:  16GB of physical memory supported Recent tests of a mid range Windows 7 based PC with configurations of 4GB, 8GB and 16GB of system memory have shown only a marginal overall performance benefit between 8GB and 4GB. No performance improvement was evident when moving from 8GB to 16GB, therefore I do not see the 16GB physical memory limitation of Home Edition to be an issue when choosing an operating system. Backup and restore Home Premium:  Limited to local HDD or DVD The Backup and Restore centre was first int...

Making a Really Cool jQuery Image Gallery

jQuery Image Gallery In this tutorial we will create a beautiful jQuery Image Gallery for website using jQuery Lightbox plugin.You can use this gallery in your website or you can show images.One of the main benefits of using a popular java script library, such as jQuery, is the incredible number of available plug-ins that will kick-start any development project. There is no need to Download the plug-in – I’ve included it in the demo files, so grab them and get on reading. The XHTML We start off with our XHTML front-end. demo.php <div id="container"> <div id="heading"> <!-- the heading --> <h1>A cool jQuery gallery</h1> </div> <div id="gallery"> <!-- this is the containing div for the images --> <?php //our php code goes here ?> <div class="clear"></div> <!-- using clearfix --> </div> <div id="footer"> <!-- some tutorial info --> </div...

How to Build a Professional Website /Learn how to build website

Build a professional website ,and earn money using your website .Learn all these all lessons step by step.Y ou will learn how to structure a web page using HTML , style a web page using CSS , and how to do all of this quickly using Bootstrap . Build the Airbnb home page and learn the fundamentals of web developmen t in the process.You will learn how to structure a web page using HTML , style a web page using CSS , and how to do all of this quickly using Bootstrap. What you will learn You will learn how to structure a web page using HTML, style a web page using CSS, and how to do all of this quickly using Bootstrap. We had done worked hard on this topic  please give us  like  &  Share  Credit..                 If you want to save your work then follow these instructions:- 1.Select 1st lesson if you are beginner 2.SignIn option is given on the header of these lessons.Click SignIn 3.SignIn using Facebook Acco...