diff --git a/demo/css/demo.css b/demo/css/demo.css new file mode 100644 index 0000000..fffdae5 --- /dev/null +++ b/demo/css/demo.css @@ -0,0 +1,236 @@ +body { + /* appearance */ + background-image: url(../images/bg.png); + background-repeat: repeat; + + /* text */ + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + } + +.styles { + display: none; + } + +input::-webkit-input-placeholder { + color: #585858; + } +input:-moz-placeholder { + color: #585858; + } + +.button { + /* appearance */ + background-color: #3f3f3f; + background-image: -moz-linear-gradient( + top, + rgba(255,255,255,0.0) 0%, + rgba(255,255,255,0.1) 50%); + + background-image: -webkit-gradient( + linear, left top, left bottom, + color-stop(100%,rgba(255,255,255,0.0)), + color-stop(50%,rgba(255,255,255,0.1))); + border: 1px solid #000000; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 0 1px 0 rgba(139,139,139,1) inset, 0 1px 0 rgba(88,88,88,1); + -moz-box-shadow: 0 1px 0 rgba(139,139,139,1) inset, 0 1px 0 rgba(88,88,88,1); + box-shadow: 0 1px 0 rgba(139,139,139,1) inset, 0 1px 0 rgba(88,88,88,1); + + /* position */ + display: inline-block; + margin: 10px 0; + + /* size */ + padding: 0 10px; + + /* text */ + color: #eaeaea; + font-size: 12px; + line-height: 30px; + text-decoration: none; + white-space: nowrap; + } +.button:hover { + /* appearance */ + background-color: #6495ed; + -webkit-box-shadow: 0 0 3px #6495ed; + -moz-box-shadow: 0 0 3px #6495ed; + box-shadow: 0 0 3px #6495ed; + } + +#buildTable { + margin-top: 20px; + } + +#tablePlaceholder { + margin-top: 40px; + } + +.table_options { + /* appearance */ + background-color: #252525; + background-image: -moz-linear-gradient( + top, + rgba(255,255,255,0.05) 20%, + rgba(255,255,255,0.0) 80%); + + background-image: -webkit-gradient( + linear, left top, left bottom, + color-stop(20%,rgba(255,255,255,0.05)), + color-stop(80%,rgba(255,255,255,0.0))); + border: 1px solid #000000; + -webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.75); + -moz-box-shadow: 0 5px 10px rgba(0,0,0,0.75); + box-shadow: 0 5px 10px rgba(0,0,0,0.75); + overflow: hidden; + + /* size */ + padding: 10px 0; + + } + h2 { + /* text */ + color: #dadada; + font-size: 14px; + font-weight: bold; + text-align: center; + text-shadow: 0 -1px 1px #000000; + } + .table_options fieldset { + /* appearance */ + border: none; + + /* size */ + padding: 5px 0; + + /* text */ + text-align: right; + } + .table_options label { + /* size */ + padding: 0 10px 0 0; + + /* text */ + color: #b2b2b2; + font-size: 12px; + text-shadow: 0 -1px 1px #000000; + + } + .table_options input, + .table_options input:focus { + /* appearance */ + background-color: #1f1f1f; + border: 1px solid #000000; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 0 1px 1px rgba(63,63,63,1), 0 1px 3px rgba(0,0,0,1) inset; + -moz-box-shadow: 0 1px 1px rgba(63,63,63,1), 0 1px 3px rgba(0,0,0,1) inset; + box-shadow: 0 1px 1px rgba(63,63,63,1), 0 1px 3px rgba(0,0,0,1) inset; + + /* size */ + padding: 8px 5px; + width: 50px; + + /* text */ + color: #fff; + } + .table_options input:focus { + outline: 1px solid #fff; + } + + + + +/* Fancy Dark Table */ +.fancyDarkTable .numeric { + /* text */ + text-align: right; + } + +.fancyDarkTable td, .fancyDarkTable th { + border: 1px solid #000000; + padding: 5px; +} + +.fancyDarkTable thead tr th { + padding: 10px 5px 10px 5px; + } + +.fancyDarkTable { + /*border-collapse: separate;*/ + + /* text */ + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + } + +.fancyDarkTable tbody tr td { + /* appearance */ + background-color: #3f3f3f; + background-image: -moz-linear-gradient( + top, + rgba(255,255,255,0.0) 0%, + rgba(255,255,255,0.02) 100%); + + background-image: -webkit-gradient( + linear, left top, left bottom, + color-stop(0%,rgba(255,255,255,0.0)), + color-stop(100%,rgba(255,255,255,0.02))); + border-bottom-color: #2f2f2f; + border-right-color: #2f2f2f; + + /* size */ + padding: 10px 5px 30px 5px; + + /* text */ + color: #FFFFFF; + font-size: 11px; + font-weight: bold; + text-shadow: 0 -1px 1px #000000; + } + +.fancyDarkTable tbody tr.odd td { + /* appearance */ + background-color: #464646; + background-image: -moz-linear-gradient( + top, + rgba(255,255,255,0.0) 0%, + rgba(255,255,255,0.02) 100%); + + background-image: -webkit-gradient( + linear, left top, left bottom, + color-stop(0%,rgba(255,255,255,0.0)), + color-stop(100%,rgba(255,255,255,0.02))); + border-right-color: #2f2f2f; + } + +.fancyDarkTable thead tr th, +.fancyDarkTable tfoot tr td { + /* appearance */ + background-color: #151515; + background-image: -moz-linear-gradient( + top, + rgba(255,255,255,0.05) 0%, + rgba(255,255,255,0.0) 100%); + + background-image: -webkit-gradient( + linear, left top, left bottom, + color-stop(0%,rgba(255,255,255,0.05)), + color-stop(100%,rgba(255,255,255,0.0))); + + /* text */ + color: #ffffff; + font-size: 12px; + font-weight: bold; + text-shadow: 0 -1px 1px #000; + } + +.fancyDarkTable .fht-head { + -webkit-box-shadow: 0 -1px 0 #3f3f3f; + -moz-box-shadow: 0 -1px 0 #3f3f3f; + box-shadow: 0 -1px 0 #3f3f3f; + z-index: 1; + position: relative; + } \ No newline at end of file diff --git a/demo/css/myTheme.css b/demo/css/myTheme.css index 70abc6e..c46e839 100644 --- a/demo/css/myTheme.css +++ b/demo/css/myTheme.css @@ -1,6 +1,49 @@ .divider { margin: 20px 0; } + +.button { + /* appearance */ + background-color: #3f3f3f; + background-image: -moz-linear-gradient( + top, + rgba(255,255,255,0.0) 0%, + rgba(255,255,255,0.1) 50%); + + background-image: -webkit-gradient( + linear, left top, left bottom, + color-stop(100%,rgba(255,255,255,0.0)), + color-stop(50%,rgba(255,255,255,0.1))); + border: 1px solid #000000; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 0 1px 0 rgba(139,139,139,1) inset, 0 1px 0 rgba(88,88,88,1); + -moz-box-shadow: 0 1px 0 rgba(139,139,139,1) inset, 0 1px 0 rgba(88,88,88,1); + box-shadow: 0 1px 0 rgba(139,139,139,1) inset, 0 1px 0 rgba(88,88,88,1); + cursor: pointer; + + /* position */ + display: inline-block; + margin: 10px; + + /* size */ + padding: 0 10px; + + /* text */ + color: #eaeaea; + font-size: 12px; + line-height: 30px; + text-decoration: none; + white-space: nowrap; + } +.button:hover { + /* appearance */ + background-color: #6495ed; + -webkit-box-shadow: 0 0 3px #6495ed; + -moz-box-shadow: 0 0 3px #6495ed; + box-shadow: 0 0 3px #6495ed; + } .myTableWrapper { width: 800px; diff --git a/demo/demo.html b/demo/demo.html new file mode 100644 index 0000000..0e7f0bc --- /dev/null +++ b/demo/demo.html @@ -0,0 +1,60 @@ + + + + FixedHeaderTable Demo + + + + + + + + +
+ +
+
+
+

Table Properties

+
+ + +
+
+ + +
+
+ +
+

Table Appearance

+
+ + +
+
+ + +
+
+ +
+

 

+
+ + +
+
+ +
+ Build Table + Run Plugin +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/demo/demo.js b/demo/demo.js index 44d37cb..6cc135a 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -1,9 +1,11 @@ $(document).ready(function() { - $('.myTable01').fixedHeaderTable({ width: '600', height: '250', footer: true, altClass: 'odd', themeClass: 'fancyTable' }); + $('.myTable01').fixedHeaderTable({ width: '600', height: '250', footer: true, cloneHeadToFoot: true, altClass: 'odd', themeClass: 'fancyTable', autoShow: false }); + + $('.myTable01').fixedHeaderTable('show', 1000); $('.myTable02').fixedHeaderTable({ width: '600', height: '250', footer: true, altClass: 'odd', themeClass: 'fancyDarkTable' }); - $('.myTable03').fixedHeaderTable({ altClass: 'odd', themeClass: 'fancyDarkTable' }); + $('.myTable03').fixedHeaderTable({ altClass: 'odd', footer: true, themeClass: 'fancyDarkTable' }); $('a.makeTable').bind('click', function() { diff --git a/demo/images/bg.png b/demo/images/bg.png new file mode 100644 index 0000000..2cf8af0 Binary files /dev/null and b/demo/images/bg.png differ diff --git a/demo/js/demo.js b/demo/js/demo.js new file mode 100644 index 0000000..0fff089 --- /dev/null +++ b/demo/js/demo.js @@ -0,0 +1,73 @@ +$(document).ready(function() { + $('#buildTable').bind('click', function(e) { + e.preventDefault(); + + $('#tablePlaceholder').empty() + .buildTable(); + }); + + $('#runPlugin').bind('click', function(e) { + e.preventDefault(); + + $('#tablePlaceholder table').fixedHeaderTable({ height: '400', altClass: 'odd', themeClass: 'fancyDarkTable' }); + }); +}); + +$.fn.extend({ + buildTable: function() { + var defaults = { + width: '100%', + height: 400, + rows: 100, + columns: 5, + borderWidth: 1, + borderColor: '#000000', + padding: 5 + }; + + var $self = $(this), + self = this, + rows = $('#rows').val(), + columns = $('#columns').val(), + borderWidth = $('#borderWidth').val(), + borderColor = $('#borderColor').val(), + padding = $('#padding').val(), + $thead, + $tbody, + $currentRow, + $styles, + options = {}; + + if ( padding != '' ) { + options.padding = padding; + } + + options = $.extend({}, defaults, options); + + $self.append('
'); + + $thead = $self.find('thead'); + $thead.append(''); + for ( var column = 1; column <= columns; column++ ) { + $thead.find('tr') + .append('Column '+column+''); + } + + $tbody = $self.find('tbody'); + for ( var row = 1; row <= rows; row++ ) { + $currentRow = $('').appendTo($tbody); + + for ( var column = 1; column <= columns; column++ ) { + $currentRow.append('Column '+column+''); + } + } + +/* + var paddingStyle = "padding: " + options.padding + "px !important;"; + + $styles = $('').appendTo('.styles'); + + $styles.html('th, td { '+paddingStyle+' }'); +*/ + } +}); \ No newline at end of file diff --git a/demo/test.html b/demo/test.html index 6cc90e3..d3a203f 100644 --- a/demo/test.html +++ b/demo/test.html @@ -6,19 +6,11 @@ + -
- -
@@ -30,16 +22,6 @@ - - - - - - - - - - @@ -187,12 +169,12 @@ - - - - - - + + + + + + @@ -375,7 +357,7 @@ - +
Bounce Rate
BrowserVisitsPages/VisitAvg. Time on Site% New VisitsBounce Rate
Firefox
BrowserVisitsPages/VisitAvg. Time on Site% New VisitsBounce RateThis is a unique footer12345