<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jQuery plugin Archives - Michael Soriano</title>
	<atom:link href="https://michaelsoriano.com/tag/jquery-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>https://michaelsoriano.com/tag/jquery-plugin/</link>
	<description>I turn code into captivating user experiences for the web</description>
	<lastBuildDate>Sat, 12 Dec 2015 17:24:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.4</generator>
	<item>
		<title>Better handling for your HTML tables in Responsive view with this jQuery Plugin</title>
		<link>https://michaelsoriano.com/better-html-table-responsive-view-jquery-plugin/</link>
					<comments>https://michaelsoriano.com/better-html-table-responsive-view-jquery-plugin/#comments</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Sat, 12 Dec 2015 17:24:14 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery plugin]]></category>
		<guid isPermaLink="false">http://fearlessflyer.com/?p=4448</guid>

					<description><![CDATA[<p>So I had another challenge at my work. You see, we use plenty of SharePoint based sites, and a lot of the markup that it outputs is table based &#8211; especially the contents of a list. Now this is fine for tabular data and such &#8211; but in mobile view, it renders horribly. The rows [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/better-html-table-responsive-view-jquery-plugin/">Better handling for your HTML tables in Responsive view with this jQuery Plugin</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>So I had another challenge at my work. You see, we use plenty of SharePoint based sites, and a lot of the markup that it outputs is table based &#8211; especially the contents of a list. Now this is fine for tabular data and such &#8211; but in mobile view, it renders horribly. The rows become too tall because of the contents getting smushed. Scollbars from left to right at the bottom of the screen.<br />
So I decided to write a jQuery plugin to alleviate this problem. It&#8217;s called it StackedRows.js.<br />
<a href="https://github.com/michaelsoriano/stacked-rows">View in Github</a><br />
<a href="http://demo.michaelsoriano.com/stacked-rows/">View Demo</a><br />
StackedRows basically goes through each of the rows in your table and creates a single row right below it &#8211; that&#8217;s only visible in mobile view. When the media query hits (you can set this up in the CSS), the ugly rows get hidden, and the mobile row displays &#8211; in a stacked vertical fashion. Hence &#8220;stacked rows&#8221;:<br />
<img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-5295" src="https://michaelsoriano.com/wp-content/uploads/2015/07/stacked-rows1.jpg" alt="stacked-rows1" width="693" height="915" srcset="https://michaelsoriano.com/wp-content/uploads/2015/07/stacked-rows1.jpg 693w, https://michaelsoriano.com/wp-content/uploads/2015/07/stacked-rows1-227x300.jpg 227w" sizes="(max-width: 693px) 100vw, 693px" /><br />
The responsive view of your table is much easier to digest in a mobile device. You can completely customize the look of each row with the stylesheet that it comes with. The best part is it still produces compliant HTML (even though it&#8217;s rendered on through Javascript).</p>
<h3>How to use:</h3>
<p>Just like a regular jQuery plugin, you need to have jQuery included in page to use. Then simply call inside a .ready() with your selectors and options included. An example is shown below:</p>
<pre>$(document).ready(function(){
   $('.table1').stackedRows();
})
</pre>
<h3>Options</h3>
<p>You can pass several options when calling the plugin. Check the table below for an explanation of how the options work.</p>
<table class="table table-bordered table-striped responsive-utilities" style="margin-top: 25px; margin-bottom: 30px;">
<thead>
<tr>
<th>Option</th>
<th>Type</th>
<th>Description</th>
<th class="hidden-xs">Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<th><code>classPrefix</code></th>
<td class="is-visible">string</td>
<td>class prefix for CSS styling</td>
<td class="is-hidden hidden-xs">sr</td>
</tr>
<tr>
<th><code>firstRowHeader</code></th>
<td class="is-hidden">bool</td>
<td>does first row of table a heading?</td>
<td class="is-visible hidden-xs">true</td>
</tr>
<tr>
<th><code>showLabels</code></th>
<td class="is-hidden">bool</td>
<td>show labels (column names) in mobile?</td>
<td class="is-hidden hidden-xs">true</td>
</tr>
<tr>
<th><code>altRowStyle</code></th>
<td class="is-hidden">bool</td>
<td>add a class for alternating rows</td>
<td class="is-hidden hidden-xs">true</td>
</tr>
</tbody>
</table>
<p>The options are quite explanatory. The demo page also shows some of the options described above.</p>
<p>The post <a href="https://michaelsoriano.com/better-html-table-responsive-view-jquery-plugin/">Better handling for your HTML tables in Responsive view with this jQuery Plugin</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/better-html-table-responsive-view-jquery-plugin/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
