;(function(){
$.fn.tabify = function(options){
// required for custom table class increment
var tableNo = 1;
return this.each(function(){
var settings = $.extend({
tableClass: "tabify",
tableCounts: "table_", //unique class for table
trFirstClass: "first-row",
colFirstClass: "first-col",
oddClass: "odd",
evenClass: "even"
}, options);
var el = $(this);
// default class to Table
el.addClass(settings.tableClass);
// unique class to Table
el.addClass(settings.tableCounts + tableNo);
// adding class to very first row of the table - considering as Header
el.find("tr:first-child").addClass(settings.trFirstClass);
// odd - even rows
el.find("tr:odd").addClass(settings.oddClass);
el.find("tr:even").addClass(settings.evenClass);
// first col
el.find("th:first-child").addClass(settings.colFirstClass);
el.find("td:first-child").addClass(settings.colFirstClass);
el.prepend("<tr><td><button class='addRow'>Add Row</button></td></tr>");
el.find(".addRow").click(function() {
el.each(function(){
var thh = el.find("tr:last-child > td").length;
var trr = $("<tr class='newAdded'></tr>");
var tdd = new Array();
for(var i=1; i<=thh; i++){
if(i == thh){
tdd.push("<td style='position: relative;'>text<button class='delButton' style='position: absolute; right: 0; font-size: 10px;...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.