<?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>Team Tutorials &#187; CSS</title>
	<atom:link href="http://teamtutorials.com/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>http://teamtutorials.com</link>
	<description></description>
	<lastBuildDate>Thu, 05 Apr 2012 19:38:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Using jQuery to Reorder a List and Update a Database</title>
		<link>http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-jquery-to-reorder-a-list-and-update-a-database</link>
		<comments>http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database#comments</comments>
		<pubDate>Wed, 30 Sep 2009 21:05:23 +0000</pubDate>
		<dc:creator>John Ward</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[Web Development Tutorials]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Reorder]]></category>

		<guid isPermaLink="false">http://teamtutorials.com/?p=2126</guid>
		<description><![CDATA[This tutorial will show you how to use jQuery to allow as list (UL) to be reordered and will also make an AJAX call to a PHP file that will update the database when an item is dropped. I found this useful for a project I was working on recently. The user wanted to be able to change the order that categories displayed in a report. The items are stored in a database with a field called display_order. When the report is generated we simply order by that field.]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to use jQuery to allow as list (UL) to be reordered and will also make an AJAX call to a PHP file that will update the database when an item is dropped. I found this useful for a project I was working on recently. The user wanted to be able to change the order that categories displayed in a report. The items are stored in a database with a field called display_order. When the report is generated we simply order by that field.</p>
<p><strong>This tutorial requires:</strong></p>
<ul>
<li>A web server that handles PHP and MySql or <a href="http://teamtutorials.com/web-development-tutorials/setting-up-a-wamp-server">setup a local  Windows Apache MySql Php web server.</a></li>
<li> <a href="http://jqueryui.com/download"> jQuery and jQuery UI</a>.
<li>Basic HTML/CSS/Javascript knowledge.</li>
</ul>
<p>First you are going to need to <a href="http://jqueryui.com/download" target=="blank">download jQuery Ui.</a> There are plenty of feature within jQuery User Interface that I will not be touching in this tutorial, but for sake of the tutorial download the entire bundle. Also I will be using the default (UI Lightness) theme.<br />
Create a folder for this project on your server. You will need to unzip the jQuery files and put them all in this directory.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-01.gif"><img src="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-01.gif" alt="jquery-reorder-tutorial-01" title="jquery-reorder-tutorial-01" width="700" height="417" class="alignnone size-full wp-image-2129" /></a></p>
<p>Since jQuery comes with an example called index.html I am going to name my file test.php. You can call it whatever you want. Create the file. We will use it later. We&#8217;ll set the database up first.</p>
<p>I like to use <a href=" http://www.heidisql.com/" target="blank">HeidiSQL</a> when working with MySQL. Now on the database server I am going to create a database call test_tutorials, with a table called report_items. Here are the field properties for the report_items table:<br />
<a href="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-02.gif"><img src="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-02.gif" alt="jquery-reorder-tutorial-02" title="jquery-reorder-tutorial-02" width="624" height="159" class="alignnone size-full wp-image-2130" /></a></p>
<p>Now populate your table with some test data. I&#8217;ll insert 6 rows. Also make sure you insert the display order starting from 0.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-03.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-03.jpg" alt="jquery-reorder-tutorial-03" title="jquery-reorder-tutorial-03" width="576" height="235" class="alignnone size-full wp-image-2131" /></a></p>
<p>You can save the changes to your data base and get back to working on test.php. Open the file. We&#8217;ll start with the basic layout. </p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Reorder Test&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Next we&#8217;ll include the stylesheet from our jQuery theme. I&#8217;ll also add some CSS from the example on the jQuery UI website. Then we&#8217;ll include the jQuery javascript files.</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Reorder Test&lt;/title&gt;
&lt;/head&gt;

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;development-bundle/themes/base/ui.all.css&quot;/&gt;

&lt;style type=&quot;text/css&quot;&gt;
	#sortable {
		list-style-type: none;
		margin: 0;
		padding: 0;
		width: 60%;
	}
	#sortable li {
		margin: 0 3px 3px 3px;
		padding: 0.4em;
		padding-left: 1.5em;
		font-size: 1.4em;
		height: 18px;
	}
	#sortable li span {
		position: absolute;
		margin-left: -1.3em;
	}
&lt;/style&gt;

&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt; &lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-ui-1.7.2.custom.min.js&quot;&gt;&lt;/script&gt;

&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>We are going to pull the intial data from the database. In order to do this we&#8217;ll need to make a database connection. Create a new file called connect.php and create a database connection (obvious added your credentials where needed.</p>
<pre class="brush: php; title: Code Snippet:; notranslate">
&lt;?php

$servername='localhost'; //no need to change if the file is located on the same server
$dbusername='username'; //your db username
$dbpassword='password'; //your db password
$dbname='database'; //for this tutorial I called my db test_tutorials

connecttodb($servername,$dbname,$dbusername,$dbpassword);
function connecttodb($servername,$dbname,$dbuser,$dbpassword){
	global $link;
	$link=mysql_connect ($servername,$dbuser,$dbpassword);
	if(!$link){die(&quot;Could not connect to MySQL&quot;);}
	mysql_select_db($dbname,$link) or die (&quot;could not open db&quot;.mysql_error());
}

?&gt;
</pre>
<p>Save connect.php and include it into your test.php file:</p>
<pre class="brush: php; title: Code Snippet:; notranslate">
&lt;?php include('connect.php');?&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Reorder Test&lt;/title&gt;
&lt;/head&gt;

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;development-bundle/themes/base/ui.all.css&quot;/&gt;

&lt;style type=&quot;text/css&quot;&gt;
	#sortable {
		list-style-type: none;
		margin: 0;
		padding: 0;
		width: 60%;
	}
	#sortable li {
		margin: 0 3px 3px 3px;
		padding: 0.4em;
		padding-left: 1.5em;
		font-size: 1.4em;
		height: 18px;
	}
	#sortable li span {
		position: absolute;
		margin-left: -1.3em;
	}
&lt;/style&gt;

&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt; &lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-ui-1.7.2.custom.min.js&quot;&gt;&lt;/script&gt;

&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now we need to retrieve the database results and dsiplay them. The items will be display in an un-ordered list. We&#8217;ll add this code to the body.</p>
<pre class="brush: php; title: Code Snippet:; notranslate">
&lt;body&gt;
	&lt;ul id=&quot;sortable&quot;&gt;
    &lt;?php
	$sql = &quot;select * from report_items order by Category_Display_Order ASC&quot;;
	$query = mysql_query($sql);

	while($row = mysql_fetch_array($query))
	{
		$catid = $row['Category_ID'];
		$catname = $row['Category_Name'];
		echo &quot;&lt;li id='item_$catid' class='ui-state-default'&gt;&lt;span class='ui-icon ui-icon-arrowthick-2-n-s'&gt;&lt;/span&gt;$catname&lt;/li&gt;&quot;;
	}

	?&gt;
    &lt;/ul&gt;
&lt;/body&gt; </pre>
<p>Take not above. When we echo the li we are adding the ui-state-default class which is just a jQuery theme class and the span that we included is an arrow icon also provide with jQuery Ui. Where you see item_$catid, that should be your primary key from your database (this will be used later to reorder items.</p>
<p>Now save the file and load it in your browser. If you followed everything hopefully you will get something like this:<br />
<a href="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-04.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-04.jpg" alt="jquery-reorder-tutorial-04" title="jquery-reorder-tutorial-04" width="700" height="183" class="alignnone size-full wp-image-2132" /></a></p>
<p>Now we&#8217;ll enable the sortable function on our list. Remeber I gave the UL tag an id of sortable. Add this code in the head below your jquery javascript files:</p>
<pre class="brush: jscript; title: Code Snippet:; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
	$(function() {
		$(&quot;#sortable&quot;).sortable({
			placeholder: 'ui-state-highlight',
		});
		$(&quot;#sortable&quot;).disableSelection();
	});
&lt;/script&gt;
</pre>
<p>The code above enables sorting of the UL with the id #sortable. The placeholder: &#8216;ui-state-highlight&#8217; tells jquery we want it to show a place holder of where we can drop the item. In the them I am using it is a yellow box. Make the changes above and save your page. You should now be able to drap and drop your list items.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-05.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-05.jpg" alt="jquery-reorder-tutorial-05" title="jquery-reorder-tutorial-05" width="700" height="206" class="alignnone size-full wp-image-2133" /></a></p>
<p>Now that you have that working we can move to the AJAX call. When an item is dropped, we want to call a php file to update the database. We do that by using the stop: action. So when dragging stops, the script will call the url (updatedb.php) we provided below. To make the AJAZ called, we let jQuery do the work.</p>
<pre class="brush: jscript; title: Code Snippet:; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
	$(function() {
		$(&quot;#sortable&quot;).sortable({
			placeholder: 'ui-state-highlight',
			stop: function(i) {
				placeholder: 'ui-state-highlight'
				$.ajax({
					type: &quot;GET&quot;,
					url: &quot;updatedb.php&quot;,
					data: $(&quot;#sortable&quot;).sortable(&quot;serialize&quot;)});
			}
		});
		$(&quot;#sortable&quot;).disableSelection();
	});
&lt;/script&gt;
</pre>
<p>You see the ajax function above. We tell it what type of request, in this case wer&#8217;ll use get variables. We also tell it what URL, this is a php file we&#8217;ll create to update the database. Then we add the data that will be sent. </p>
<p>The code $(&#8220;#sortable&#8221;).sortable(&#8220;serialize&#8221;)}); will take the items within our ordered list and serialize it. It will take the items of the list, in whatever order they are in, and turn them into a get variable. So for each item it will add it to an array and format is properly to make the call to the PHP file. The data will look like this:<br />
item[]=1&#038;item[]=2&#038;item[]=3&#038;item[]=4&#038;item[]=5&#038;item[]=6</p>
<p>If you want to debug AJAX request I recommend  using Firefox with the Firebug plugin. If you want to see that the request is being attempted and that what the data looks like, you can add an alert box just below the placeholder like this: alert($(&#8220;#sortable&#8221;).sortable(&#8220;serialize&#8221;));<br />
Save the changes to you file we are done with test.php. Here is my full source of test.php up to this point.</p>
<pre class="brush: plain; title: Code Snippet:; notranslate">
&lt;?php include('connect.php');?&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Reorder Test&lt;/title&gt;
&lt;/head&gt;

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;development-bundle/themes/base/ui.all.css&quot;/&gt;

&lt;style type=&quot;text/css&quot;&gt;
	#sortable {
		list-style-type: none;
		margin: 0;
		padding: 0;
		width: 60%;
	}
	#sortable li {
		margin: 0 3px 3px 3px;
		padding: 0.4em;
		padding-left: 1.5em;
		font-size: 1.4em;
		height: 18px;
	}
	#sortable li span {
		position: absolute;
		margin-left: -1.3em;
	}
&lt;/style&gt;

&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-ui-1.7.2.custom.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	$(function() {
		$(&quot;#sortable&quot;).sortable({
			placeholder: 'ui-state-highlight',
			stop: function(i) {
				placeholder: 'ui-state-highlight'
				$.ajax({
					type: &quot;GET&quot;,
					url: &quot;updatedb.php&quot;,
					data: $(&quot;#sortable&quot;).sortable(&quot;serialize&quot;)});
			}
		});
		$(&quot;#sortable&quot;).disableSelection();
	});
&lt;/script&gt;
&lt;body&gt;
	&lt;ul id=&quot;sortable&quot;&gt;
    &lt;?php
	$sql = &quot;select * from report_items order by Category_Display_Order ASC&quot;;
	$query = mysql_query($sql);

	while($row = mysql_fetch_array($query))
	{
		$catid = $row['Category_ID'];
		$catname = $row['Category_Name'];
		echo &quot;&lt;li id='item_$catid' class='ui-state-default'&gt;&lt;span class='ui-icon ui-icon-arrowthick-2-n-s'&gt;&lt;/span&gt;$catname&lt;/li&gt;&quot;;
	}

	?&gt;
    &lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now we need to actually update the database. Create a file called updatedb.php. This file is pretty simple. We take each item in the array and then update the database based on the array position($key) and the primary key ($value)</p>
<pre class="brush: php; title: Code Snippet:; notranslate">
&lt;?php
include('connect.php');

foreach($_GET['item'] as $key=&gt;$value) {
	mysql_query(&quot;UPDATE report_items SET Category_Display_Order = '$key' WHERE Categoryt_ID ='$value';&quot;);
}
?&gt; </pre>
<p>Save that file and test the reorder. If you have problems and you think it is with the AJAX call. Check fire bug. Here is an example of a bad request in this case I tried to include a file that was not there.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-06.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2009/09/jquery-reorder-tutorial-06.jpg" alt="jquery-reorder-tutorial-06" title="jquery-reorder-tutorial-06" width="700" height="277" class="alignnone size-full wp-image-2134" /></a></p>
<p><strong>I hope this tutorial helped someone out</strong></p>
<ul>
<li><a href="http://demos.teamtutorials.com/jquery_reoder_list/list_tutorial.rar">Download Source</a></li>
<li><a href="http://demos.teamtutorials.com/jquery_reoder_list/">View Live Demo (no database interaction)</a></li>
</ul>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://teamtutorials.com/web-development-tutorials/simple-php-website-templates" title="Simple PHP Website Templates">Simple PHP Website Templates</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript" title="Hide and Show a Div Using Javascript">Hide and Show a Div Using Javascript</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/installing-code-editor" title="Installing Code Editor">Installing Code Editor</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/how-to-return-mysql-results-to-a-table" title="How to Return MySQL Results to a Table">How to Return MySQL Results to a Table</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/creating-checkboxes-based-on-sql-results" title="Creating Checkboxes Based on SQL Results">Creating Checkboxes Based on SQL Results</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database/feed</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Simple PHP Website Templates</title>
		<link>http://teamtutorials.com/web-development-tutorials/simple-php-website-templates?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=simple-php-website-templates</link>
		<comments>http://teamtutorials.com/web-development-tutorials/simple-php-website-templates#comments</comments>
		<pubDate>Mon, 25 Aug 2008 17:10:50 +0000</pubDate>
		<dc:creator>John Ward</dc:creator>
				<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[Web Development Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://teamtutorials.com/?p=1647</guid>
		<description><![CDATA[So you have a basic HTML site with 100 pages, what happens when you want to change the title tag? Well, if you aren’t using PHP includes, you will have to update each file. Wouldn’t it be nice if you could make the change to one file and it would update every page? That is what we will accomplish with our basic PHP template tutorial.]]></description>
			<content:encoded><![CDATA[<p>So you have a basic HTML site with 100 pages, what happens when you want to change the title tag? Well, if you aren&#8217;t using PHP includes, you will have to update each file. Wouldn&#8217;t it be nice if you could make the change to one file and it would update every page? That is what we will accomplish with our basic PHP template tutorial.</p>
<p>This tutorial will require a server that can handle PHP code. If you would like to set one up on your computer, check out Mike&#8217;s “<a href="http://teamtutorials.com/web-development-tutorials/setting-up-a-wamp-server">Installing WAMP tutorial</a>”.</p>
<p>First, if you don&#8217;t have a website that you would like to break up into a template, you can use the sample<a href="http://www.456bereastreet.com/lab/developing_with_web_standards/csslayout/2-col/"> 2 column layout </a>below from 456bereastreet.com </p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
        &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;title&gt;Simple 2 column CSS layout, final layout | 456 Berea Street&lt;/title&gt;
	&lt;meta name=&quot;description&quot; content=&quot;How to create a simple two column CSS layout with full width header and footer.&quot;&gt;
	&lt;meta name=&quot;copyright&quot; content=&quot;Copyright (c) 2004 Roger Johansson&quot;&gt;
	&lt;meta name=&quot;author&quot; content=&quot;Roger Johansson&quot;&gt;
	&lt;style type=&quot;text/css&quot;&gt;
	body,
	html {
		margin:0;
		padding:0;
		background:#a7a09a;
		color:#000;
	}
	body {
		min-width:750px;
	}
	#wrap {
		background:#99c;
		margin:0 auto;
		width:750px;
	}
	#header {
		background:#ddd;
	}
	#header h1 {
    	padding:5px;
	    margin:0;
    }
	#nav {
		background:#c99;
		padding:5px;
	}
	#nav ul{
		margin:0;
		padding:0;
		list-style:none;
	}
	#nav li{
		display:inline;
		margin:0;
		padding:0;
	}
	#main {
		background:#9c9;
		float:left;
		width:500px;
	}
	#main h2, #main h3, #main p {
		padding:0 10px;
    }
	#sidebar {
		background:#99c;
		float:right;
		width:240px;
	}
	#sidebar ul {
		margin-bottom:0;
    }
    #sidebar h3, #sidebar p {
		padding:0 10px 0 0;
    }
	#footer {
		background:#cc9;
		clear:both;
	}
	#footer p {
		padding:5px;
		margin:0;
    }
	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;wrap&quot;&gt;
	&lt;div id=&quot;header&quot;&gt;&lt;h1&gt;Simple 2 column CSS layout, final layout&lt;/h1&gt;&lt;/div&gt;
	&lt;div id=&quot;nav&quot;&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 1&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 2&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 3&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 4&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 5&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
	&lt;div id=&quot;main&quot;&gt;
		&lt;h2&gt;Column 1&lt;/h2&gt;
		&lt;p&gt;&lt;a href=&quot;/&quot;&gt;456 Berea Street Home&lt;/a&gt; | &lt;a href=&quot;/lab/developing_with_web_standards/csslayout/2-col/&quot;&gt;Simple 2 column CSS layout&lt;/a&gt; | &lt;a href=&quot;http://www.456bereastreet.com/lab/developing_with_web_standards/&quot;&gt;Developing with web standards index&lt;/a&gt;&lt;/p&gt;
		&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna. Mauris risus nunc, tristique varius, gravida in, lacinia vel, elit. Nam ornare, felis non faucibus molestie, nulla augue adipiscing mauris, a nonummy diam ligula ut risus. Praesent varius. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.&lt;/p&gt;
		&lt;p&gt;Nulla a lacus. Nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pulvinar lobortis purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec semper ipsum et urna. Ut consequat neque vitae felis. Suspendisse dapibus, magna quis pulvinar laoreet, dolor neque lacinia arcu, et luctus mi erat vestibulum sem. Mauris faucibus iaculis lacus. Aliquam nec ante in quam sollicitudin congue. Quisque congue egestas elit. Quisque viverra. Donec feugiat elementum est. Etiam vel lorem.&lt;/p&gt;
		&lt;p&gt;Aenean tempor. Mauris tortor quam, elementum eu, convallis a, semper quis, purus. Cras at tortor in purus tincidunt tristique. In hac habitasse platea dictumst. Ut eu lectus eu metus molestie iaculis. In ornare. Donec at enim vel erat tempor congue. Nullam varius. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla feugiat hendrerit risus. Integer enim velit, gravida id, sollicitudin at, consequat sit amet, leo. Fusce imperdiet condimentum velit. Phasellus nonummy interdum est. Pellentesque quam.&lt;/p&gt;
		&lt;h3&gt;Consectetuer adipiscing elit&lt;/h3&gt;
		&lt;p&gt;Nulla dictum. Praesent turpis libero, pretium in, pretium ac, malesuada sed, ligula. Sed a urna eu ipsum luctus faucibus. Curabitur fringilla. Suspendisse sit amet quam. Sed vel pede id libero luctus fermentum. Vestibulum volutpat tempor lectus. Vivamus convallis tempus ante. Nullam adipiscing dui blandit ipsum. Nullam convallis lacus ut quam. Mauris semper elit at ante. Vivamus tristique. Pellentesque pharetra ante at pede. In ultrices arcu vitae purus. In rutrum, erat at mollis consequat, leo massa consequat libero, ac vestibulum libero tellus sed risus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/p&gt;
		&lt;p&gt;Maecenas eu velit nec magna venenatis consequat. In neque. Vivamus pellentesque, lacus eu aliquet semper, lorem metus rhoncus metus, a ornare orci ante a diam. Nunc sem nisl, aliquet quis, elementum nec, imperdiet in, wisi. Proin in lorem. Etiam molestie diam eget ante. Morbi quis tortor id lacus mollis venenatis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam vel orci sit amet tellus mollis eleifend. Donec urna diam, viverra eget, ultricies gravida, ultrices eu, erat. Proin vel arcu. Sed diam. Cras hendrerit arcu sed augue. Sed justo felis, luctus a, accumsan in, tincidunt facilisis, libero. Phasellus eu eros.&lt;/p&gt;
	&lt;/div&gt;
	&lt;div id=&quot;sidebar&quot;&gt;
		&lt;h3&gt;Column 2&lt;/h3&gt;
		&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna.&lt;/p&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 1&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 2&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 3&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 4&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 5&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 6&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 7&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 8&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 9&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 10&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 11&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 12&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 13&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 14&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 15&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
	&lt;div id=&quot;footer&quot;&gt;
		&lt;p&gt;Footer&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>We are going to break the page up into individual files, and then use PHP includes to join them again. Here is a break down of how the files will be separated.</p>
<p><a href="http://teamtutorials.com/wp-content/uploads/2008/08/php-templates-1.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2008/08/php-templates-1.jpg" alt="" title="php-templates-1" width="500" height="305" class="alignnone size-full wp-image-1648" /></a></p>
<p>The first step is to is to create a new PHP file. This file will be for the header, so I will name it header.php (you could also name these header.inc if you would like). We will cut all of the code from the beginning HTML tag all the way down to the end of the header section and paste it in this file. The file should look like this:</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">

&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
        &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;title&gt;Simple 2 column CSS layout, final layout | 456 Berea Street&lt;/title&gt;
	&lt;meta name=&quot;description&quot; content=&quot;How to create a simple two column CSS layout with full width header and footer.&quot;&gt;
	&lt;meta name=&quot;copyright&quot; content=&quot;Copyright (c) 2004 Roger Johansson&quot;&gt;
	&lt;meta name=&quot;author&quot; content=&quot;Roger Johansson&quot;&gt;
	&lt;style type=&quot;text/css&quot;&gt;
	body,
	html {
		margin:0;
		padding:0;
		background:#a7a09a;
		color:#000;
	}
	body {
		min-width:750px;
	}
	#wrap {
		background:#99c;
		margin:0 auto;
		width:750px;
	}
	#header {
		background:#ddd;
	}
	#header h1 {
    	padding:5px;
	    margin:0;
    }
	#nav {
		background:#c99;
		padding:5px;
	}
	#nav ul{
		margin:0;
		padding:0;
		list-style:none;
	}
	#nav li{
		display:inline;
		margin:0;
		padding:0;
	}
	#main {
		background:#9c9;
		float:left;
		width:500px;
	}
	#main h2, #main h3, #main p {
		padding:0 10px;
    }
	#sidebar {
		background:#99c;
		float:right;
		width:240px;
	}
	#sidebar ul {
		margin-bottom:0;
    }
    #sidebar h3, #sidebar p {
		padding:0 10px 0 0;
    }
	#footer {
		background:#cc9;
		clear:both;
	}
	#footer p {
		padding:5px;
		margin:0;
    }
	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div id=&quot;wrap&quot;&gt;
	&lt;div id=&quot;header&quot;&gt;&lt;h1&gt;Simple 2 column CSS layout, final layout&lt;/h1&gt;&lt;/div&gt;
</pre>
<p>Next we will cut the code for the top menu and paste it into a file called top-menu.php</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">

&lt;div id=&quot;nav&quot;&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 1&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 2&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 3&lt;/a&gt;&lt;/li&gt;

			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 4&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Option 5&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
</pre>
<p>And the last part is to cut from the div id=”sidebar” to the end of the page and paste it in sidebar.php. You could also separate the footer into its own file, but for the is example I will include it into the sidebar.</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">

&lt;div id=&quot;sidebar&quot;&gt;
		&lt;h3&gt;Column 2&lt;/h3&gt;
		&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna.&lt;/p&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 1&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 2&lt;/a&gt;&lt;/li&gt;

			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 3&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 4&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 5&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 6&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 7&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 8&lt;/a&gt;&lt;/li&gt;

			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 9&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 10&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 11&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 12&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 13&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 14&lt;/a&gt;&lt;/li&gt;

			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 15&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
	&lt;div id=&quot;footer&quot;&gt;
		&lt;p&gt;Footer&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now if you cut all of those lines, it should leave you with the following code in your original file:</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">

	&lt;div id=&quot;main&quot;&gt;
		&lt;h2&gt;Column 1&lt;/h2&gt;
		&lt;p&gt;&lt;a href=&quot;/&quot;&gt;456 Berea Street Home&lt;/a&gt; | &lt;a href=&quot;/lab/developing_with_web_standards/csslayout/2-col/&quot;&gt;Simple 2 column CSS layout&lt;/a&gt; | &lt;a href=&quot;http://www.456bereastreet.com/lab/developing_with_web_standards/&quot;&gt;Developing with web standards index&lt;/a&gt;&lt;/p&gt;

		&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna. Mauris risus nunc, tristique varius, gravida in, lacinia vel, elit. Nam ornare, felis non faucibus molestie, nulla augue adipiscing mauris, a nonummy diam ligula ut risus. Praesent varius. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.&lt;/p&gt;
		&lt;p&gt;Nulla a lacus. Nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pulvinar lobortis purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec semper ipsum et urna. Ut consequat neque vitae felis. Suspendisse dapibus, magna quis pulvinar laoreet, dolor neque lacinia arcu, et luctus mi erat vestibulum sem. Mauris faucibus iaculis lacus. Aliquam nec ante in quam sollicitudin congue. Quisque congue egestas elit. Quisque viverra. Donec feugiat elementum est. Etiam vel lorem.&lt;/p&gt;
		&lt;p&gt;Aenean tempor. Mauris tortor quam, elementum eu, convallis a, semper quis, purus. Cras at tortor in purus tincidunt tristique. In hac habitasse platea dictumst. Ut eu lectus eu metus molestie iaculis. In ornare. Donec at enim vel erat tempor congue. Nullam varius. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla feugiat hendrerit risus. Integer enim velit, gravida id, sollicitudin at, consequat sit amet, leo. Fusce imperdiet condimentum velit. Phasellus nonummy interdum est. Pellentesque quam.&lt;/p&gt;
		&lt;h3&gt;Consectetuer adipiscing elit&lt;/h3&gt;
		&lt;p&gt;Nulla dictum. Praesent turpis libero, pretium in, pretium ac, malesuada sed, ligula. Sed a urna eu ipsum luctus faucibus. Curabitur fringilla. Suspendisse sit amet quam. Sed vel pede id libero luctus fermentum. Vestibulum volutpat tempor lectus. Vivamus convallis tempus ante. Nullam adipiscing dui blandit ipsum. Nullam convallis lacus ut quam. Mauris semper elit at ante. Vivamus tristique. Pellentesque pharetra ante at pede. In ultrices arcu vitae purus. In rutrum, erat at mollis consequat, leo massa consequat libero, ac vestibulum libero tellus sed risus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/p&gt;
		&lt;p&gt;Maecenas eu velit nec magna venenatis consequat. In neque. Vivamus pellentesque, lacus eu aliquet semper, lorem metus rhoncus metus, a ornare orci ante a diam. Nunc sem nisl, aliquet quis, elementum nec, imperdiet in, wisi. Proin in lorem. Etiam molestie diam eget ante. Morbi quis tortor id lacus mollis venenatis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam vel orci sit amet tellus mollis eleifend. Donec urna diam, viverra eget, ultricies gravida, ultrices eu, erat. Proin vel arcu. Sed diam. Cras hendrerit arcu sed augue. Sed justo felis, luctus a, accumsan in, tincidunt facilisis, libero. Phasellus eu eros.&lt;/p&gt;

	&lt;/div&gt;
</pre>
<p>So now we have all of the code broken down into include files. How do we put them all back together?</p>
<p>Create a file called template.php, we will use this as the template to build each content page. Now we just have to include the pages we just created. When using include, the web server will render the code from the included pages before the browser interprets it. You will see later that the source code will be identical if viewed in the browser.</p>
<p>This is what your template.php file should look like:</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">

&lt;?php include('header.php');?&gt;

&lt;?php include('top-menu.php');?&gt;

	&lt;div id=&quot;main&quot;&gt;
		&lt;h2&gt;Column 1&lt;/h2&gt;
		&lt;p&gt;&lt;a href=&quot;/&quot;&gt;456 Berea Street Home&lt;/a&gt; | &lt;a href=&quot;/lab/developing_with_web_standards/csslayout/2-col/&quot;&gt;Simple 2 column CSS layout&lt;/a&gt; | &lt;a href=&quot;http://www.456bereastreet.com/lab/developing_with_web_standards/&quot;&gt;Developing with web standards index&lt;/a&gt;&lt;/p&gt;

		&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna. Mauris risus nunc, tristique varius, gravida in, lacinia vel, elit. Nam ornare, felis non faucibus molestie, nulla augue adipiscing mauris, a nonummy diam ligula ut risus. Praesent varius. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.&lt;/p&gt;
		&lt;p&gt;Nulla a lacus. Nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pulvinar lobortis purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec semper ipsum et urna. Ut consequat neque vitae felis. Suspendisse dapibus, magna quis pulvinar laoreet, dolor neque lacinia arcu, et luctus mi erat vestibulum sem. Mauris faucibus iaculis lacus. Aliquam nec ante in quam sollicitudin congue. Quisque congue egestas elit. Quisque viverra. Donec feugiat elementum est. Etiam vel lorem.&lt;/p&gt;
		&lt;p&gt;Aenean tempor. Mauris tortor quam, elementum eu, convallis a, semper quis, purus. Cras at tortor in purus tincidunt tristique. In hac habitasse platea dictumst. Ut eu lectus eu metus molestie iaculis. In ornare. Donec at enim vel erat tempor congue. Nullam varius. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla feugiat hendrerit risus. Integer enim velit, gravida id, sollicitudin at, consequat sit amet, leo. Fusce imperdiet condimentum velit. Phasellus nonummy interdum est. Pellentesque quam.&lt;/p&gt;
		&lt;h3&gt;Consectetuer adipiscing elit&lt;/h3&gt;
		&lt;p&gt;Nulla dictum. Praesent turpis libero, pretium in, pretium ac, malesuada sed, ligula. Sed a urna eu ipsum luctus faucibus. Curabitur fringilla. Suspendisse sit amet quam. Sed vel pede id libero luctus fermentum. Vestibulum volutpat tempor lectus. Vivamus convallis tempus ante. Nullam adipiscing dui blandit ipsum. Nullam convallis lacus ut quam. Mauris semper elit at ante. Vivamus tristique. Pellentesque pharetra ante at pede. In ultrices arcu vitae purus. In rutrum, erat at mollis consequat, leo massa consequat libero, ac vestibulum libero tellus sed risus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/p&gt;
		&lt;p&gt;Maecenas eu velit nec magna venenatis consequat. In neque. Vivamus pellentesque, lacus eu aliquet semper, lorem metus rhoncus metus, a ornare orci ante a diam. Nunc sem nisl, aliquet quis, elementum nec, imperdiet in, wisi. Proin in lorem. Etiam molestie diam eget ante. Morbi quis tortor id lacus mollis venenatis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam vel orci sit amet tellus mollis eleifend. Donec urna diam, viverra eget, ultricies gravida, ultrices eu, erat. Proin vel arcu. Sed diam. Cras hendrerit arcu sed augue. Sed justo felis, luctus a, accumsan in, tincidunt facilisis, libero. Phasellus eu eros.&lt;/p&gt;

	&lt;/div&gt;

&lt;?php include('sidebar.php');?&gt;
</pre>
<p> Then when creating a new file, simple use the template and change the content in the main div to the new content. When you want to add a link to that page you can add it in sidebar.php or top-menu.php</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database" title="Using jQuery to Reorder a List and Update a Database">Using jQuery to Reorder a List and Update a Database</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/installing-code-editor" title="Installing Code Editor">Installing Code Editor</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/how-to-return-mysql-results-to-a-table" title="How to Return MySQL Results to a Table">How to Return MySQL Results to a Table</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript" title="Hide and Show a Div Using Javascript">Hide and Show a Div Using Javascript</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/styling-html-tables-with-tablecloth" title="Styling HTML Tables with TableCloth">Styling HTML Tables with TableCloth</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://teamtutorials.com/web-development-tutorials/simple-php-website-templates/feed</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Hide and Show a Div Using Javascript</title>
		<link>http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hide-and-show-a-div-using-javascript</link>
		<comments>http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript#comments</comments>
		<pubDate>Sun, 27 Jul 2008 15:01:47 +0000</pubDate>
		<dc:creator>John Ward</dc:creator>
				<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[JavaScriptTutorials]]></category>
		<category><![CDATA[Web Development Tutorials]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javasciprt]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://teamtutorials.com/?p=1612</guid>
		<description><![CDATA[This tutorial will show you how to create a hidden Div and display it with the click of a link. There are a few reasons you may want to hide a Div in a website design. You may want to create a drop down type menu or a box that will show more information when you click a link. Another reason would be for SEO purposes. In theory hiding information in a Div is not against Google’s rules. As long as the user can still see the content when clicking a button you are not displaying different information to the user than you are to the search engine.]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to create a hidden Div and display it with the click of a link. There are a few reasons you may want to hide a Div in a website design. You may want to create a drop down type menu or a box that will show more information when you click a link. Another reason would be for SEO purposes. In theory hiding information in a Div is not against Google’s rules. As long as the user can still see the content when clicking a button you are not displaying different information to the user than you are to the search engine.</p>
<p>First we are going to start with a very basic page layout and create a 2 Divs. One will be shown and one will be hidden. Here is the starting code.</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;Hidden Div&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;main&quot;&gt;This is not hidden.&lt;/div&gt;

&lt;div id=&quot;hidden&quot;&gt;This is hidden.&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;

Ok now I will add some basic style to these boxes.
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;Hidden Div&lt;/title&gt;

&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
#main{
	width:500px;
	height: 20px;
	background: lightblue;
}
#hidden {
	width:300px;
	height:20px;
	background: lightgrey;
}
--&gt;
&lt;/style&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;main&quot;&gt;This is not hidden.&lt;/div&gt;

&lt;div id=&quot;hidden&quot;&gt;This is hidden.&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The page should look like this so far.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-01.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-01.jpg" alt="" title="hide-show-div-with-javascript-01" width="510" height="80" class="alignnone size-medium wp-image-1613" /></a></p>
<p>Now to hide the div. To do this we will change the display to none in the CSS for the #hidden div. See the code below.</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;Hidden Div&lt;/title&gt;

&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
#main{
	width:500px;
	height: 20px;
	background: lightblue;
}
#hidden {
	width:300px;
	height:20px;
	background: lightgrey;
	display: none;
}
--&gt;
&lt;/style&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;main&quot;&gt;This is not hidden.&lt;/div&gt;

&lt;div id=&quot;hidden&quot;&gt;This is hidden.&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now when you preview the page you will not see the Div.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-02.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-02.jpg" alt="" title="hide-show-div-with-javascript-02" width="500" height="51" class="alignnone size-full wp-image-1614" /></a></p>
<p>In order to show the div we will need to add a Javascript function. We will pass the ID attribute of the Div to the function. Basically this means that we can use this one function to show or hide more than one Div on the same page. Below is the Javascript code that we will add the the Head section of the page.</p>
<pre class="brush: jscript; title: Code Snippet:; notranslate">
&lt;script language=&quot;JavaScript&quot;&gt;
	function toggle(id) {
		var state = document.getElementById(id).style.display;
			if (state == 'block') {
				document.getElementById(id).style.display = 'none';
			} else {
				document.getElementById(id).style.display = 'block';
			}
		}
&lt;/script&gt;
</pre>
<p>The script above is creating the function “toggle” an passing the value “id”. Next we are using the Document Object Model to get the current state of the display attribute. Then if “display: block;” for the #hidden div we will change it to be “display: none;” else we will change the display to none. </p>
<p>Add the code to your page in the head just below the style.</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;Hidden Div&lt;/title&gt;

&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
#main{
	width:500px;
	height: 20px;
	background: lightblue;
}
#hidden {
	width:300px;
	height:20px;
	background: lightgrey;
	display: none;
}
--&gt;
&lt;/style&gt;

&lt;script language=&quot;JavaScript&quot;&gt;
	function toggle(id) {
		var state = document.getElementById(id).style.display;
			if (state == 'block') {
				document.getElementById(id).style.display = 'none';
			} else {
				document.getElementById(id).style.display = 'block';
			}
		}
&lt;/script&gt; 

&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;main&quot;&gt;This is not hidden.&lt;/div&gt;

&lt;div id=&quot;hidden&quot;&gt;This is hidden.&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now all we have to do is create a link that will call the toggle function and pass the ID of the Div we want to toggle. We will create a link that goes no where and add the onclick property below.</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;a href=&quot;#&quot; onclick=&quot;toggle('hidden');&quot;&gt;Toggle Div&lt;/a&gt;
</pre>
<p>Add the link to your visible div.</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;Hidden Div&lt;/title&gt;

&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
#main{
	width:500px;
	height: 20px;
	background: lightblue;
}
#hidden {
	width:300px;
	height:20px;
	background: lightgrey;
	display: none;
}
--&gt;
&lt;/style&gt;

&lt;script language=&quot;JavaScript&quot;&gt;
	function toggle(id) {
		var state = document.getElementById(id).style.display;
			if (state == 'block') {
				document.getElementById(id).style.display = 'none';
			} else {
				document.getElementById(id).style.display = 'block';
			}
		}
&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;main&quot;&gt;
	This is not hidden.
	&lt;a href=&quot;#&quot; onclick=&quot;toggle('hidden');&quot;&gt;Toggle Div&lt;/a&gt;
&lt;/div&gt;

&lt;div id=&quot;hidden&quot;&gt;This is hidden.&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Save the file and test. You should not see the Div when the page loads. When you click the toggle link the hidden box will appear.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-03.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-03.jpg" alt="" title="hide-show-div-with-javascript-03" width="500" height="175" class="alignnone size-full wp-image-1615" /></a></p>
<p>Here is an example of something you could use this for. I have a site for deals on clothing. Now if we wanted to add some quality SEO content to help the site rank we could put it in a hidden div so that it doesn’t distract the customer.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-04.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-04.jpg" alt="" title="hide-show-div-with-javascript-04" width="500" height="277" class="alignnone size-full wp-image-1616" /></a></p>
<p>When the div is clicked it could expand with SEO rich content and links.<br />
<a href="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-05.jpg"><img src="http://teamtutorials.com/wp-content/uploads/2008/07/hide-show-div-with-javascript-05.jpg" alt="" title="hide-show-div-with-javascript-05" width="500" height="264" class="alignnone size-full wp-image-1617" /></a></p>
<p>I know the tutorial was pretty basic, but I hope that the example above gives you an idea of how this can be used. I may also expand this into another tutorial and show you how to create a nice menu using the technique.</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database" title="Using jQuery to Reorder a List and Update a Database">Using jQuery to Reorder a List and Update a Database</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/html-tutorials/javascript-progress-bar" title="JavaScript Progress Bar">JavaScript Progress Bar</a></li><li><a href="http://teamtutorials.com/other-tutorials/receiving-dynamic-textbox-data" title="Receiving Dynamic Textbox Data">Receiving Dynamic Textbox Data</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/dynamically-add-textbox-to-site" title="Dynamically Add Textbox to Site">Dynamically Add Textbox to Site</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/styling-html-tables-with-tablecloth" title="Styling HTML Tables with TableCloth">Styling HTML Tables with TableCloth</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript/feed</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Styling HTML Tables with TableCloth</title>
		<link>http://teamtutorials.com/web-development-tutorials/styling-html-tables-with-tablecloth?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=styling-html-tables-with-tablecloth</link>
		<comments>http://teamtutorials.com/web-development-tutorials/styling-html-tables-with-tablecloth#comments</comments>
		<pubDate>Mon, 16 Jun 2008 05:01:58 +0000</pubDate>
		<dc:creator>John Ward</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[Web Development Tutorials]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://teamtutorials.com/?p=1562</guid>
		<description><![CDATA[In this tutorial I will show you how to apply some simple style to your tables by applying the TableCloth style sheet and JavaScript file. TableCloth is a free, light way, way to add style to existing HTML tables. It only required two lines of code added to your table. With table clothe you can also modify how the HTML tables react to your input by changing the JavaScript file. ]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I will show you how to apply some simple style to your tables by applying the TableCloth style sheet and JavaScript file. TableCloth is a free, light way, way to add style to existing HTML tables. It only required two lines of code added to your table. With table clothe you can also modify how the HTML tables react to your input by changing the JavaScript file. </p>
<p><a href="http://cssglobe.com/lab/tablecloth/">First you will need to download the TableCloth files from CSS Globe. </a></p>
<p>Extract the files and save them, we will use them later. For the next part of the tutorial we need to have a table made already. If you don’t have a table made you can use this code</p>
<pre class="brush: xml; title: Code Snippet:; notranslate">
&lt;html&gt;

&lt;head&gt;

&lt;title&gt;Styling Tables with TableCloth&lt;/title&gt;

&lt;/head&gt;

&lt;table&gt;

  &lt;tr&gt;

  &lt;th&gt;First Name&lt;/th&gt;
  &lt;th&gt;Last name&lt;/th&gt;
  &lt;th&gt;Age&lt;/th&gt;

  &lt;/tr&gt;

  &lt;tr&gt;

    &lt;td&gt;John&lt;/td&gt;
    &lt;td&gt;Ward&lt;/td&gt;
    &lt;td&gt;21&lt;/td&gt;

  &lt;/tr&gt;

  &lt;tr&gt;

    &lt;td&gt;Mike&lt;/td&gt;
    &lt;td&gt;Maguire&lt;/td&gt;
    &lt;td&gt;21&lt;/td&gt;

  &lt;/tr&gt;

  &lt;tr&gt;

    &lt;td&gt;Sara&lt;/td&gt;
    &lt;td&gt;Lee&lt;/td&gt;
    &lt;td&gt;61&lt;/td&gt;

  &lt;/tr&gt;

  &lt;tr&gt;

    &lt;td&gt;Walter&lt;/td&gt;
    &lt;td&gt;Reed&lt;/td&gt;
    &lt;td&gt;1&lt;/td&gt;

  &lt;/tr&gt;

&lt;/table&gt;
&lt;/html&gt;
</pre>
<p>Save the file as table.htm and open it with your browser. The table should look like this<br />
<a href='http://teamtutorials.com/wp-content/uploads/2008/06/01.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/01.jpg" alt="Styling HTML Tables with TableCloth" title="Styling HTML Tables with TableCloth" width="223" height="151" class="alignnone size-full wp-image-1563" /></a></p>
<p>The table is very plain looking, but that can be changed with a few lines of code. We will add two lines of code in the head of our page.</p>
<p><html></p>
<p><head></p>
<link href="tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="tablecloth/tablecloth.js"></script></p>
<p></head></p>
<p>Now we need to copy the tablecloth folder into the directory with our table.htm<br />
<a href='http://teamtutorials.com/wp-content/uploads/2008/06/02.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/02.jpg" alt="Styling HTML Tables with TableCloth" title="Styling HTML Tables with TableCloth" width="373" height="258" class="alignnone size-medium wp-image-1564" /></a></p>
<p>Note that there are two folders named “tablecloth” when you extract the files, we want to copy the folder that contains these files:<br />
<a href='http://teamtutorials.com/wp-content/uploads/2008/06/03.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/03.jpg" alt="Styling HTML Tables with TableCloth" title="Styling HTML Tables with TableCloth" width="583" height="182" class="alignnone size-medium wp-image-1565" /></a></p>
<p>After you copy the files over and add the changes to the header of table.htm, refresh the page. Your table should now be styles by tablecloth.<br />
<a href='http://teamtutorials.com/wp-content/uploads/2008/06/04.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/04.jpg" alt="Styling HTML Tables with TableCloth" title="Styling HTML Tables with TableCloth" width="635" height="213" class="alignnone size-medium wp-image-1566" /></a></p>
<p>By default the table columns are highlighted when you hover over them with the mouse.<br />
<a href='http://teamtutorials.com/wp-content/uploads/2008/06/05.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/05.jpg" alt="Styling HTML Tables with TableCloth" title="Styling HTML Tables with TableCloth" width="635" height="213" class="alignnone size-medium wp-image-1567" /></a></p>
<p>Also when you click on an item the entire columns turns a green color.<br />
Image06</p>
<p>These values can be changed in the tablecloth.js file which is located in the tablecloth folder. This info is near the top of the file in the config section. </p>
<pre class="brush: jscript; title: Code Snippet:; notranslate">

	// if set to true then mouseover a table cell will highlight entire column (except sibling headings)
	var highlightCols = true;

	// if set to true then mouseover a table cell will highlight entire row	(except sibling headings)
	var highlightRows = false;	

	// if set to true then click on a table sell will select row or column based on config
	var selectable = true;
</pre>
<p>So if you wanted only the rows to be highlighted you would change the config to look like this.</p>
<pre class="brush: jscript; title: Code Snippet:; notranslate">

	// if set to true then mouseover a table cell will highlight entire column (except sibling headings)
	var highlightCols = false;

	// if set to true then mouseover a table cell will highlight entire row	(except sibling headings)
	var highlightRows = true;	

	// if set to true then click on a table sell will select row or column based on config
	var selectable = true;
</pre>
<p>Then the table would look like this on mouse over.<br />
<a href='http://teamtutorials.com/wp-content/uploads/2008/06/07.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/07.jpg" alt="Styling HTML Tables with TableCloth" title="Styling HTML Tables with TableCloth" width="635" height="213" class="alignnone size-medium wp-image-1568" /></a></p>
<p>You can even highlight both column and row if you would like or turn of the green highlighting on click. As you can see the file is easy to manipulation and the lines are commented so it should be easy to figure out. There is also a CSS file included that you can modify. I am not going to go into modifying the default style in this tutorial. All it takes to modify the style is some basic CSS knowledge. </p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript" title="Hide and Show a Div Using Javascript">Hide and Show a Div Using Javascript</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/installing-code-editor" title="Installing Code Editor">Installing Code Editor</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database" title="Using jQuery to Reorder a List and Update a Database">Using jQuery to Reorder a List and Update a Database</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/how-to-return-mysql-results-to-a-table" title="How to Return MySQL Results to a Table">How to Return MySQL Results to a Table</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/simple-php-website-templates" title="Simple PHP Website Templates">Simple PHP Website Templates</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://teamtutorials.com/web-development-tutorials/styling-html-tables-with-tablecloth/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Code Editor</title>
		<link>http://teamtutorials.com/web-development-tutorials/installing-code-editor?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-code-editor</link>
		<comments>http://teamtutorials.com/web-development-tutorials/installing-code-editor#comments</comments>
		<pubDate>Mon, 09 Jun 2008 04:59:30 +0000</pubDate>
		<dc:creator>Mike Maguire</dc:creator>
				<category><![CDATA[Software Tutorials]]></category>
		<category><![CDATA[Web Development Tutorials]]></category>
		<category><![CDATA[code editor]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://teamtutorials.com/?p=1540</guid>
		<description><![CDATA[This tutorial will walk you through installing Crimson Editor (Emerald Editor) which will allow you to work with many types of codes files including PHP, HTML, DHTML, XML, and many more.]]></description>
			<content:encoded><![CDATA[<p>	This tutorial will walk you through installing Crimson Editor (Emerald Editor) which will allow you to work with many types of codes files including PHP, HTML, DHTML, XML, and many more. The software is essentially a notepad replacement that will highlight the syntax of the code that you are working with, like below:</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_01.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_01.jpg" alt="installing_crimson_code_editor_01" title="installing_crimson_code_editor_01" width="577" height="345" class="alignnone size-full wp-image-1541" /></a></p>
<p>As you can see, this makes working with the code a lot easier and there is less confusion. Let’s get started installing our software.</p>
<p>First we need to download the software to be installed. To do this, go to <a href="http://www.crimsoneditor.com/">http://www.crimsoneditor.com</a>.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_02.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_02.jpg" alt="installing_crimson_code_editor_02" title="installing_crimson_code_editor_02" width="133" height="124" class="alignnone size-medium wp-image-1542" /></a></p>
<p>Once the site loads, click on download on the left as shown above.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_03.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_03.jpg" alt="installing_crimson_code_editor_03" title="installing_crimson_code_editor_03" width="525" height="118" class="alignnone size-medium wp-image-1543" /></a></p>
<p>Then click on one of the download links to begin the download.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_04.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_04.jpg" alt="installing_crimson_code_editor_04" title="installing_crimson_code_editor_04" width="381" height="162" class="alignnone size-medium wp-image-1544" /></a></p>
<p>Select to save the file to your hard drive and put it where you can easily access it once it is done downloading. I placed mine on the desktop.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_05.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_05.jpg" alt="installing_crimson_code_editor_05" title="installing_crimson_code_editor_05" width="71" height="52" class="alignnone size-medium wp-image-1545" /></a></p>
<p>You should now have an icon where you elected to save the file. Double click on the icon to get the setup started.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_06.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_06.jpg" alt="installing_crimson_code_editor_06" title="installing_crimson_code_editor_06" width="404" height="309" class="alignnone size-medium wp-image-1546" /></a></p>
<p>If you get this alert, click to allow the software to be executed/installed.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_07.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_07.jpg" alt="installing_crimson_code_editor_07" title="installing_crimson_code_editor_07" width="503" height="393" class="alignnone size-medium wp-image-1547" /></a></p>
<p>The first section is the license agreement. Read through itand then click “I Agree” to continue.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_08.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_08.jpg" alt="installing_crimson_code_editor_08" title="installing_crimson_code_editor_08" width="503" height="393" class="alignnone size-medium wp-image-1548" /></a></p>
<p>This is the component selection screen. You can choose whether you want to have Start Menu group, and Quick Launch button. I recommend keeping the syntax files. These are the files that tells it how to “color” the text when you are working with code.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_09.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_09.jpg" alt="installing_crimson_code_editor_09" title="installing_crimson_code_editor_09" width="503" height="393" class="alignnone size-medium wp-image-1549" /></a></p>
<p>This window allows you to pick where you install the files for it to run. If you don’t know, you can leave it default and it will work fine.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_10.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_10.jpg" alt="installing_crimson_code_editor_10" title="installing_crimson_code_editor_10" width="503" height="393" class="alignnone size-medium wp-image-1550" /></a></p>
<p>Once it has completed installing all of the files, the window should like the one above. Click on close to conclude the installation.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_11.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_11.jpg" alt="installing_crimson_code_editor_11" title="installing_crimson_code_editor_11" width="329" height="146" class="alignnone size-medium wp-image-1551" /></a></p>
<p>The first time you launch it will you receive the above box telling you that the config file has been corrupted and that it is setting up the defaults. This is simply because you don’t have a config file since you haven’t run it yet.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_12.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_12.jpg" alt="installing_crimson_code_editor_12" title="installing_crimson_code_editor_12" width="536" height="377" class="alignnone size-medium wp-image-1552" /></a></p>
<p>Launch the application using the icon on your desktop or the quick launch icon (if you set them to appear in the installation). Once in the application click on File and then Open.</p>
<p><a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_13.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_13.jpg" alt="installing_crimson_code_editor_13" title="installing_crimson_code_editor_13" width="428" height="273" class="alignnone size-medium wp-image-1553" /></a></p>
<p>The above window will open. These are files that are included with the editor for you to open to see the syntax highlighting at work. Pick any file you want and double-click on it.<br />
<a href='http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_14.jpg'><img src="http://teamtutorials.com/wp-content/uploads/2008/06/installing_crimson_code_editor_14.jpg" alt="installing_crimson_code_editor_14" title="installing_crimson_code_editor_14" width="543" height="309" class="alignnone size-medium wp-image-1554" /></a></p>
<p>This shows what the code I chose to open looks like. This concludes setting up this software for you to use. Go out and start coding some awesome applications. Thanks for reading.</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://teamtutorials.com/web-development-tutorials/using-jquery-to-reorder-a-list-and-update-a-database" title="Using jQuery to Reorder a List and Update a Database">Using jQuery to Reorder a List and Update a Database</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/simple-php-website-templates" title="Simple PHP Website Templates">Simple PHP Website Templates</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/hide-and-show-a-div-using-javascript" title="Hide and Show a Div Using Javascript">Hide and Show a Div Using Javascript</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/dynamically-add-textbox-to-site" title="Dynamically Add Textbox to Site">Dynamically Add Textbox to Site</a></li><li><a href="http://teamtutorials.com/web-development-tutorials/styling-html-tables-with-tablecloth" title="Styling HTML Tables with TableCloth">Styling HTML Tables with TableCloth</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://teamtutorials.com/web-development-tutorials/installing-code-editor/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

