<?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-table &#8211; Extreme Web Designs</title>
	<atom:link href="https://theextremewebdesigns.com/blog/tag/jquery-table/feed/" rel="self" type="application/rss+xml" />
	<link>https://theextremewebdesigns.com/blog</link>
	<description>Web Design and Web Development</description>
	<lastBuildDate>Fri, 08 Jun 2012 09:32:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>
<site xmlns="com-wordpress:feed-additions:1">156673191</site>	<item>
		<title>jQuery Remove Column From Table Examples</title>
		<link>https://theextremewebdesigns.com/blog/jquery-remove-column-remove-column-from-table-using-jquery-examples/</link>
					<comments>https://theextremewebdesigns.com/blog/jquery-remove-column-remove-column-from-table-using-jquery-examples/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 08 Jun 2012 09:32:12 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[jquery-table]]></category>
		<category><![CDATA[jquery-tips]]></category>
		<guid isPermaLink="false">https://theextremewebdesigns.com/blog/?p=861</guid>

					<description><![CDATA[Ever wanted to remove column from table or remove multiple columns from a table using jQuery? In this article, I am going to show you with examples, how easy it is to remove / delete table column using jQuery. How to Remove Single Column or Multiple Columns From A Table using jQuery Following is the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Ever wanted to <em><strong>remove column from table or remove multiple columns from a table using jQuery</strong></em>? In this article, I am going to show you with examples, how easy it is to remove / delete table column using jQuery.<span id="more-861"></span></p>
<h2>How to Remove Single Column or Multiple Columns From A Table using jQuery</h2>
<p>Following is the HTML source code I used for the examples:</p>
<p><strong>HTML Source:</strong></p>
<pre class="lang:xhtml decode:true">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Remove Table Columns&lt;/title&gt;
&lt;script type="text/javascript" src="js/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" id="my_table"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;H1&lt;/th&gt;
&lt;th&gt;H2&lt;/th&gt;
&lt;th&gt;H3&lt;/th&gt;
&lt;th&gt;H4&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;button id="remove_column"&gt;Remove Column&lt;/button&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<p>In this example, we are going to remove table columns when the &#8220;Remove Column&#8221; button is clicked. So all code will go into the click event of the button. With that in mind, let&#8217;s take a look at how you can <strong>remove a single column and / or remove multiple columns from table using jQuery</strong>. The acutal code will be following by additional code that you can use to remove the headers as well, if they exist in your table.</p>
<h3>Example 1 (a): Remove all Columns except first column of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_column").click( function() {

//Remove all columns except first column

$('#my_table td:not(:nth-child(1))').remove();

//Remove all columns except first column along with Header

$('#my_table th:not(:nth-child(1)), #my_table td:not(:nth-child(1))').remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 1 (b): Remove all Columns except first column of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_column").click( function() {

//Alternate way to Remove all columns except first column

$("#my_table").find("td:not(:nth-child(1))").remove();

//Alternate way to Remove all columns except first column along with Header

$("#my_table").find("th:not(:nth-child(1)), td:not(:nth-child(1))").remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 2: Remove only second column of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_column").click( function() {

//Remove only 2nd column

$('#my_table td:nth-child(2)').remove();

//Remove only 2nd column along with Header

$('#my_table th:nth-child(2), #my_table td:nth-child(2)').remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 3: Remove only third column of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_column").click( function() {

//Remove only 3rd column

$('#my_table td:nth-child(3)').remove();

//Remove only 3rd column along with Header

$('#my_table th:nth-child(3), #my_table td:nth-child(3)').remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 4: Remove all Columns except second column of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_column").click( function() {

//Remove all columns except second

$('#my_table td:not(:nth-child(2))').remove();

//Remove all columns except second along with Header

$('#my_table th:not(:nth-child(2)), #my_table td:not(:nth-child(2))').remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 5: Remove last column of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_column").click( function() {

//Remove last column

$('#my_table td:last-child').remove();

//Remove last column along with Header

$('#my_table th:last-child, #my_table td:last-child').remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 6: Remove all Columns except last column of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_column").click( function() {

//Remove all columns except last column

$('#my_table td:not(:last-child)').remove();

//Remove all columns except last column along with Header

$('#my_table th:not(:last-child), #my_table td:not(:last-child)').remove();
});

});

&lt;/script&gt;</pre>
<p>As you see, all it takes is just 1 line of code to remove the column that you desire.</p>
<h5>Your Turn!</h5>
<p>Do you know of any other ways to <em><strong>remove table column or remove columns from table using jQuery</strong></em>? Share your answers by commenting below.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://theextremewebdesigns.com/blog/jquery-remove-column-remove-column-from-table-using-jquery-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">861</post-id>	</item>
		<item>
		<title>jQuery Table Remove Rows Examples</title>
		<link>https://theextremewebdesigns.com/blog/jquery-table-remove-row-remove-multiple-rows-from-table-examples/</link>
					<comments>https://theextremewebdesigns.com/blog/jquery-table-remove-row-remove-multiple-rows-from-table-examples/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 08 Jun 2012 08:09:44 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[jquery-table]]></category>
		<category><![CDATA[jquery-tips]]></category>
		<guid isPermaLink="false">https://theextremewebdesigns.com/blog/?p=857</guid>

					<description><![CDATA[Ever wanted to remove single row from table or remove multiple rows from a table using jQuery? In this article, I am going to show you with examples, how easy it is to remove / delete table row using jQuery. How to Remove Single Row or Multiple Rows From A Table using jQuery Following is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Ever wanted to <em><strong>remove single row from table or remove multiple rows from a table using jQuery</strong></em>? In this article, I am going to show you with examples, how easy it is to remove / delete table row using jQuery.<span id="more-857"></span></p>
<h2>How to Remove Single Row or Multiple Rows From A Table using jQuery</h2>
<p>Following is the HTML source code I used for the examples:</p>
<p><strong>HTML Source:</strong></p>
<pre class="lang:xhtml decode:true">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;jQuery Table Remove Row | Remove Multiple Rows from Table Examples&lt;/title&gt;
&lt;script type="text/javascript" src="js/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" id="my_table"&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;button id="remove_row"&gt;Remove Row&lt;/button&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<p>In this example, we are going to remove table rows when the &#8220;Remove Row&#8221; button is clicked. So all code will go into the click event of the button. With that in mind, let&#8217;s take a look at how you can remove a single row and / or remove multiple rows from table using jQuery.</p>
<h3>Example 1 (a): Remove all Rows except first row of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_row").click( function() {

//Remove all rows except first row

//$("#my_table").find("tr:gt(0)").remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 1 (b): Remove all Rows except first row of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_row").click( function() {

//Alternate way to Remove all rows except first row

$("#my_table").find("tr:not(:first)").remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 2: Remove only second row of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_row").click( function() {

//Remove only 2nd row

$("#my_table").find("tr:eq(1)").remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 3: Remove only third row of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_row").click( function() {

//Remove only 3rd row

//$("#my_table").find("tr:eq(2)").remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 4: Remove all Rows except second row of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_row").click( function() {

//Remove all rows except second

$("#my_table").find("tr:not(:eq(1))").remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 5: Remove last row of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_row").click( function() {

//Remove last row

$('#my_table tr:last').remove();

});

});

&lt;/script&gt;</pre>
<h3>Example 6: Remove all Rows except last row of table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

$("#remove_row").click( function() {

//Remove all rows except last row

$("#my_table").find("tr:not(:last)").remove();

});

});

&lt;/script&gt;</pre>
<p>As you see, all it takes is just 1 line of code to remove the row that you desire.</p>
<h5>Your Turn!</h5>
<p>Do you know of any other ways to <strong>remove table row or remove rows from table using jQuery</strong>? Share your answers by commenting below.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://theextremewebdesigns.com/blog/jquery-table-remove-row-remove-multiple-rows-from-table-examples/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">857</post-id>	</item>
		<item>
		<title>jQuery Table Rows Count Examples</title>
		<link>https://theextremewebdesigns.com/blog/jquery-table-rows-count-count-rows-in-table-using-jquery-example/</link>
					<comments>https://theextremewebdesigns.com/blog/jquery-table-rows-count-count-rows-in-table-using-jquery-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 08 Jun 2012 04:45:15 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[jquery-demos]]></category>
		<category><![CDATA[jquery-table]]></category>
		<category><![CDATA[jquery-tips]]></category>
		<guid isPermaLink="false">https://theextremewebdesigns.com/blog/?p=847</guid>

					<description><![CDATA[Did you want to count the rows of a table using jQuery but did not know where to start from? In  get table rows count in jQuery by using just 1 line of code. Follow along to learn how. Examples in jQuery to Get Table Rows Count There are couple of ways to use jQuery to get table [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Did you want to count the rows of a table using jQuery but did not know where to start from? In  <em><strong>get table rows count in jQuery</strong> </em>by using just 1 line of code. Follow along to learn how.<span id="more-847"></span></p>
<h2>Examples in jQuery to Get Table Rows Count</h2>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=847" method="post" name="form1" target="_blank" id="form1">


	<input type="hidden" name="shortcode_content" id="shortcode_content" value="" />

        <div class="try_demo_btn_container">


            <button type="submit" name="sbt_make_demo" id="sbt_make_demo" class="btn-primary btn-try-demo">
                Try Demo
            </button>


        </div><!-- .try_demo_btn_container -->

    </form>
    </div>
    
<p>There are couple of ways to use <strong>jQuery to get table rows count</strong>.  It can be obtained by using the <strong>.length</strong> property. We are going to look at them now by means of examples.</p>
<h3>Example 1: Count Rows in Table using jQuery</h3>
<pre class="lang:xhtml decode:true">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Count Table Rows with jQuery&lt;/title&gt;
&lt;script type="text/javascript" src="js/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" id="my_table"&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;button name="count_table_rows" id="count_table_rows"&gt;Count Table Rows&lt;/button&gt;
&lt;script type="text/javascript"&gt;

$('#count_table_rows').click(function() {

var rows = $("#my_table tr").length;

alert('Total Rows: '+rows);

});

&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>In the above example, simply click on the button and that will alert the number of rows in the table.</p>
<h3>Example 2 &#8211; Count Rows in Table using jQuery</h3>
<p>Alternately, instead of using .length property, you can use <strong>size() method</strong> to <strong>get table rows count</strong>. Simply use the following jQuery code instead of the one listed in the code above:</p>
<pre class="lang:xhtml decode:true">&lt;script type="text/javascript"&gt;

$('#count_table_rows').click(function() {

var rows = $("#my_table tr").size();

alert('Total Rows: '+rows);

});

&lt;/script&gt;</pre>
<p>The above code produces the same result as the earlier code.</p>
<h2>jQuery length vs size()</h2>
<p>Now that you have noticed that both length vs size() do the same thing, then what exactly is the difference between them. Functionality wise, there is no difference. They do the same thing. <strong>The .length property is preferred because it does not have the overhead of a function call and hence it is quicker to execute</strong>.</p>
<p>So now that you know the difference, use .length property from here on and make your code run even more faster.</p>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=847" method="post" name="form1" target="_blank" id="form1">


	<input type="hidden" name="shortcode_content" id="shortcode_content" value="" />

        <div class="try_demo_btn_container">


            <button type="submit" name="sbt_make_demo" id="sbt_make_demo" class="btn-primary btn-try-demo">
                Try Demo
            </button>


        </div><!-- .try_demo_btn_container -->

    </form>
    </div>
    
<h5>That&#8217;s it for now!</h5>
<p>Do you know of any other ways to <em><strong>get table rows count using jQuery</strong></em>? Feel free to suggest by commenting below.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://theextremewebdesigns.com/blog/jquery-table-rows-count-count-rows-in-table-using-jquery-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">847</post-id>	</item>
	</channel>
</rss>
