<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Anthology of Ideas &#187; quick and dirty</title>
	<atom:link href="http://anthologyoi.com/tag/quick-and-dirty/feed" rel="self" type="application/rss+xml" />
	<link>http://anthologyoi.com</link>
	<description>Anthology of Ideas is an archive of thoughts and form.</description>
	<lastBuildDate>Sat, 03 Mar 2012 11:16:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Spreadsheet to Table Plugin</title>
		<link>http://anthologyoi.com/wordpress/plugins/spreadsheet-to-table.html</link>
		<comments>http://anthologyoi.com/wordpress/plugins/spreadsheet-to-table.html#comments</comments>
		<pubDate>Sat, 21 Apr 2007 20:48:50 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[quick and dirty]]></category>
		<category><![CDATA[spreadsheet data]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://anthologyoi.com/wordpress/plugins/spreadsheet-to-table.html</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>This was an extremely quick project to turn spreadsheet data into an XHTML table. The plugin is quite simple to use, just copy some data from a spreadsheet ( or the visible part of an XHTML table) and paste it into a blog post between the tags [table] and [/table] (make sure that columns are tab separated and rows are on their own line). <strong>This is a no frills plugin.</strong> The first row is used as the column names and is added to a thead tag. Anything can be added to the [table] tag after &#8220;table&#8221; and it will become the table&#8217;s caption. EX [table "This is an example table"]</p>
<p>So this:<br />
<pre class="brush: php">[table &quot;This is an example table&quot;]
gf	sfg	sfcx	dfg
asd	sd	dsfs	
xcv	fds		sgdf
dfg		dfg	dfg
	dfg	dfg	dfg
[/table]</pre></p>
<p>Becomes:</p>
<table>
<caption> &#8220;This is an example table&#8221;</caption>
<thead>
<tr>
<td>gf</td>
<td>sfg</td>
<td>sfcx</td>
<td>dfg</td>
</tr>
</thead>
<tbody>
<tr>
<td>
asd</td>
<td>sd</td>
<td>dsfs</td>
<td></td>
</tr>
<tr>
<td>
xcv</td>
<td>fds</td>
<td></td>
<td>sgdf</td>
</tr>
<tr>
<td>
dfg</td>
<td></td>
<td>dfg</td>
<td>dfg</td>
</tr>
<tr>
<td>
</td>
<td>dfg</td>
<td>dfg</td>
<td>dfg</td>
</tr>
</tbody>
</table>
<p>Installation:</p>
<ol>
<li>Copy and Paste the contents of the texbox below into a .php file.</li>
<li>Upload and activate.</li>
</ol>
<p><pre class="brush: php">&lt;?php
/*
Plugin Name: Tabeler
Plugin URI:  http://anthologyoi.com/plugins/
Description: This plugin allows you to copy data directly from a spreadsheet and paste it into your blog, and will automatically create a table for it.
Version: 0.1
Author: Aaron Harun. 
Author URI: http://anthologyoi.com
*/

add_filter(&#039;the_content&#039;,&#039;tabler_find&#039;,1);
add_filter(&#039;the_excerpt&#039;,&#039;tabler_find&#039;,1);

function tabler_find($content) {
	return preg_replace_callback(&#039;!\[table([^]]*)\](?:\r\n|\n|\r|)([\S\s]*?\t[\S\s]*?)(?:\r\n|\n|\r|)\[/table\]!ims&#039;, &#039;tabler_callback&#039;, $content);
}


function tabler_callback($matches) {

	$pos_table = $matches[2];

	if(strpos($pos_table,chr(13)) !== FALSE){
		$rows = explode(chr(13),$pos_table);
	}else{
		$rows = explode(&quot;\n&quot;,$pos_table);
	}

	if(is_array($rows)){
		if($rows &gt; 1){
			$table .= &#039;&lt;table&gt;&#039;;

		foreach($rows as $row){
		$i++;
			$cols = explode(&quot;\t&quot;,$row);

			if($i==1)
				$table .= &#039;&lt;thead&gt;&#039;;

			$table .= &#039;&lt;tr&gt;&#039;;

			foreach($cols as $col){
				$table .= &#039;&lt;td&gt;&#039;.$col.&#039;&lt;/td&gt;&#039;;
			}

			$table .= &#039;&lt;/tr&gt;&#039;;

			if($i==1){
				$table .= &#039;&lt;/thead&gt;&#039;;

				$table .= &#039;&lt;tbody&gt;&#039;;
			}
		}
			$table .= &#039;&lt;/tbody&gt;&#039;;

			$table .= &#039;&lt;/table&gt;&#039;;
			
			return $table;
		}
	}
}

?&gt;</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://anthologyoi.com/wordpress/plugins/spreadsheet-to-table.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

