Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mislz28/public_html/wp-content/themes/css-faq-v2/timeweather/timeweather.php on line 19
  • Web Design
25 May 2008

Sortable Table Techniques

at what time you start on designing your web page, you might desire to mull over placing all of your page content within a html table. This will allow you to regulate your table’s cellspacing to stay your text from display too close to the left edge of your webpage. The senior the cellspacing worth, the additional away from the absent border your text will be shown. In adding up, tables will make possible for you to exhibit your page content in rows and columns rather than one big block of text.
Tables are shaped up with the <TABLE></TABLE> tags. The <TABLE> tag begin the table code and the </TABLE> tag ends the table.

The fundamental Table Structure:
<TABLE BORDER >
<TR >
<TD >Content</TD >
</TR >
</TABLE >

Nofunc Table Organize - can reorder rows and columns have the very pleasant looking. Recommended!
jpg
HTML
<table id=”table” cellspacing=”0″ onselectstart=”return false”>
<thead>
<tr class=”asc” id=”head”><th style=”width: 25px”>#</th><th style=”width: 350px”>Title</th><th>Artist</th><th style=”width: 150px”>Time</th><th style=”width: 150px”>Rating</th><th style=”width: 17px;”> </th></tr>
</thead>
<tbody id=”tbody”>
<tr><td>1</td><td>High Hopes</td><td>Pink Floyd</td><td>6:59</td><td>★★★★★</td><td onclick=”trRM(this.parentNode);”>x</td></tr>
<tr><td>2</td><td>Reflection</td><td>Tool</td><td>12:07</td><td>★★★★★</td><td onclick=”trRM(this.parentNode);”>x</td></tr>
<tr id=”this”><td>3</td><td>Tubular Bells</td><td>Mike Oldfield</td><td>25:35</td><td>★★★★</td><td onclick=”trRM(this.parentNode);”>x</td></tr>
</tbody>
</table>

Brixontech Table Sort - the paging as well as sorting Ajax table with complete tutorials for installation.
jpg

TableKit – that is base on the Prototype framework and every table matter is editable.

TableKit is the collection of HTML table improvements by using Prototype framework. TableKit at present outfits row striping, column resizing, column sorting and cell editing by using Ajax.
jpg

Sortable Selectable Zebra Table - selectable function is actually useful, optional.
Zebra tables are the great way to show data in easy manner on eyes.

Here, we detailed on Jop de Klein’s alteration of original zebra tables writing by David F. Miller. These unique scripts give base for styling the html tables with irregular row colors and permitting row selection by making use of simple JavaScript.

These tables are sortable. By going on the designated header, table will type itself using JavaScript. This fraction of widget are taken from a website called the kryogenix.org’s sortable tables.
What has the website eklekt.com added?

Well, primary of all, we have joint two scripts to function together. We have expanded sortable script to permit user to state which columns must be sortable. This means, if you have column that you don’t want to sort by, you can. As well, we wrote a script to permit you to submit selected rows of the table by using form by the way, your sort is preserved when you present. You can have links in the zebra/sortable tables. finally, you can also have above one zebra table or else sortable table, or combination, on similar page. Check it out under.

Striping Functionality
Give table the class name of “striped.” JavaScript will discover all of “striped” tables and make zebra striped. All rows to be striped have to be inside the tbody tag.

Sorting
Give your table the class of “sortable.” Javascript will clutch first row of table (not of necessity in thead tag) as well as will aim to make every cell sortable. Only cells that also have the class of “sortable” might be given functionality to class that feature. As a result, you can prohibit sorting of exact columns by not totaling that group declaration.

The script will mechanically detect data type of a column based on first row to be sorted out and not the “header” row. All of the data in every column must be of same data type to make sure good sorting. Date sorting is little unbending and all of the dates must be in MM/DD/YY or else MM/DD/YYYY set-up. The forward hacks can be hyphens.)

One extra note: every tbody tag in the table is been sorted out independently. This functionality appears to be broken in Safari.
jpg

Kryogenix Sortable - its higher usage included whole rows, unsortable as well as custom sort keys.
sort table: construct all tables sortable

While web design area gradually moves missing from using the tables to put down the structure of the page, tables in fact do have the essential use, their unique use; they are for placed out tabular data. For example, imagine the table of employees.
jpg

Sorting HTML Tables with Javascript - is the extendable, inconspicuous as well as cross-browser compatible table.

This class walks through creation and installation of the thing oriented JavaScript completion of QuickSort algorithm. This writing is the extendable, inconspicuous, and cross browser well-matched way of enhancing any type of the tabular data.

Extending script
Creating your tables sortable
1. Download JavaScript file
2. Include exterior Javascript file in a document <head>
<script src=”TSorter_1.js” type=”text/javascript”></script>
3. JavaScript is to get things going
function init()
{
var Table1Sorter = new TSorter;
Table1Sorter.init(’TARGET_TABLE_ID_VALUE’);
}
window.onload = init;

That’s all! Acutely, you will be able to upload files and sort all your tables.
Extending script

But what if the table has HTML in its’ <td> tags as for example? Fine, then you need to tell script how to access the values. Do not worry even if, you have to tell it one time. For the quick instance we will think a 3 column table which has one feature whose values are enfolded in <a> tags, like so:

Table with column of links
<table id=”result_table” class=”sortable” border=”0″ cellpadding=”0″ cellspacing=”0″ rules=”none”>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2 - Link Column</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>First Cell Row 1</td>
<td><a href=”page.html”>Second Cell Row 1</a></td>
<td>Third Cell Row 1</td>
</tr>
<tr>
<td>First Cell Row 2</td>
<td><a href=”page2.html”>Second Cell Row 2</a></td>
<td>Third Cell Row 2</td>
</tr>

</tbody>
</table>

Initially, we add attribute to target <th> cell that will inform our script this column is filled with the links.
1. Add abbr attribute to <th>
<th abbr=”link_column”>Column 2 - Link Column</th>

Secondly, add the new case to setGet meaning in TSorter_1.js
2. Extending setGet function
function setGet(sortType)
{
switch(sortType)
{
case “link_column”:
get = function(index)
{
return getCell(index).firstChild.firstChild.nodeValue;
};
break;
default:
get = function(index){ return getCell(index).firstChild.nodeValue;};
break;
};
}

Upload scripts also refresh your page. Suppose all has gone then you can sort link column also. Here are a few more examples of accessing different DOM elements within your table cells.
What if your table contains HTML in its’ <td> tags as in example? Then you need to tell script how to access these values. Do not worry though, you have to tell it one time. For a fast example we will think the 3 column table, which has one column and whose values are enfolded in <a> tags, like so:
jpg

DhtmlXGrid – that is based on the Ajax-enabled JavaScript, click able, resizable and drag gable columns.

dhtmlxGrid is the Ajax enabled JavaScript network control, which gives professional solution for in place of as well as editing tabular data on web. Cautiously designed, with influential script API, the editable DHTML grid is simple configurable with the XML or js process and shows persuasive results functioning with large quantity of data.

dhtmlxGrid permits easy implementation of pleasant looking managed all through css or else predefined features DHTML tables with the rich in cell editing, set multiline headers or footers, sortable, resizable, as well as draggable features, searching, built-in filtering, and grouping abilities. many event handlers allow you add essential interactivity to the grid based interfaces. The smart rendering knowledge and built-in page hold up let this data grid to function effectively with enormous datasets.
jpg

SortedTable by Marko Mrdjenovic - can prohibit selects by clicking selected row also highlighting over.
To start utilizing Sorted Table all you require is:

* have the valid XHTML text,
* have the valid table* in document
* download following javascripts to folder on the server: Event.js plus SortedTable.js
* add class=”sorted” to a table
* include javascripts in html (<script type=”text/javascript” src=”Event.js”></script> and <script type=”text/javascript” src=”SortedTable.js”></script>)
* add following code to html <script type=”text/javascript”>onload = function() {var myTable = new SortedTable();}</script>
* if you are making use of XML Data Islands insert class regroup you must have class=”sorted regroup”)

This is not an only thing that you can do to make use of this code. If you are the advanced JavaScript developer then following examples will provide you a few more ideas.

as SortedTable does all the operations on the live DOM lists you will be able do anything with tables and it must not break many other widgets do.
jpg

Unobtrusive Table Sort
At the glance…

* Plays satisfactorily with JavaScript global name space script makes and reuses only single JavaScript object)
* Numerous columns can also be sorted at once just by pressing Shift when selecting columns by using the keyboard or else mouse
* New script sorts on the average that is based on my extremely non-scientific computations), 5 times sooner than its precursor
* Plug-in architecture makes the writing norm sort functions the breeze
* Script can also be highlighted on both alternate rows and complete columns on the table-by-table basis.
* Like the predecessor, script is completely keyboard easy to get to
* Script can properly determine the columns data type must be the data type not be openly defined data types resolute are incomplete to the numbers, text, currency values as well as dates
* script is smart sufficient not to sort the columns having the identical data
* Sort routines can also be initiated by using JavaScript
* Tables can be mechanically sorted on the column of your option, even in overturn order
* Before sort and after sort call back functions or else Object. methods can be defined for person tables
jpg

Ajax Table - can split the table on quite a few pages and presents searching the function.
jpg

. These orders are shown in the linux control line setting, as it is mine.

2. Actually, table has four columns, as the Rails mechanically add the id field.

3. If you make use of MySQL as the database, correct way is INSERT INTO items VALUES;

4. In fact, XmlHttpRequest is not actually one more HTTP ask for type. It is the traditional POST or else GET demand sent also treat by the javascript on customer side asynchronously.

5. request.xml_http_request? orders can be shortened in request.xhr?
6. Note there can have been the other ways to perform it. In fussy we can create another act (ajax_list for example) to pact with xml_http_request requests, with the associated view however without any incomplete. One difficulty of this technique here will have been the duplicate a huge part of code between list and ajax_list events. Thus, TIMTOWTDI, but DRY.

Phatfusion Sortable Table - the filtering and searchable script.
jpg

var myTable = new sortableTable(’myTable’, {
overCls: ‘over’,
onClick: function(){alert(this.id)}
});

Data types:
number
123.45
string
firstname
The Date
Can be in YYYY / MM / DD or the DD-MM-YY or the DD/MM/YY
currency
100£ (whichever exchange as long as its a solitary sign)

options
overCls
name of aclass added when mouse is over tr.
onClick
name of afunction to call on onClick event.
sortOn
number of acolumn to at first sort on (zero based).
sortBy
direction of asort (ASC / DESC) (default: ASC).
filterHide
whether or not to demonstrate just results. (default: true).

Browser compatibility
* Firefox 2 (mac / pc)
* IE 7
* IE 6
* Safari (mac)

Standardista Table Sorting - works at the major web browsers as well as can sort IP addresses.
jpg

Standardista Table Sorting is the JavaScript module, which allows you to sort the HTML data table by any of the column. Module has following advantages:

1. It works. Codebase has been experienced across the large number of Internet browsers, and in few that will not allow sorting to take place, module degrades elegantly. In these cases original table is not changed in any mode, shape or form.
2. It is inconspicuous. You add the reference to Standardista Table JavaScript files in head of your web page; add a class of the “sortable” to tables in your web page that must be sorted and you are done.
3. It is quick. Sorting the column in eight column, hundred row, table gets on average among 100 and 200 milli Seconds in testing. That is just the tenth of second for bigger table than you are often probable to put on the web page.
4. It knows different data kinds. The present version of Standardista Sorting will sort the IP Addresses, Number, Currency, Plain Text as well as Dates, and best bit if it works out what kind of sorting to do devoid of having to inform it. If you recognize a small sum of JavaScript it’s as well trivial to add latest data kinds to sort by.

Mootable Sorting Table - easy as well as elegant with balanced effect.

GridView3 - every row with expandable feature and checkbox.
jpg

Datagrid

I have come across many of these ‘live’ datagrids and gridviews and have not really got one I like. mostly because they appear to deal with the small bit of the data or code isn’t moveable. So figured to code your own and here’s what you will come up with.

We will begin with primary or else main page of live datagrid. As you observe, it’s fairly easy. Oh and this is most likely the time, which you must visit http://www.xajaxproject.org/ and make known yourself with XAJAX library. I got it to be extremely easy to function with despite lack of total documentation. Moving on…

People Say
It will be very pleasant if we can jump to web pages straight (textfield and a button ‘Go to web page:’) and if table will not reconstruct itself every time something is pressed. It will be great if the rows will refresh.
Good work

I intend optimizing this fairly. I’m thinking about making use of JSON and building table on client side of things. There is copiousness of optimizations, which can be done, agreed. The thought was to include something that is quick, easy, and the majority of all portable. This scheme is very simple to make use of in your project.
Like the thought about ‘Go To Page’ alternative. I’ll have to insert it! Thanks!

jpg
Joostdevalk Sortable Table - merely one Javascript is necessary.

Table sorting the JavaScript
Inconspicuous and with irregular row colors
Sections:
* Example table
* Quick start
* Donate
* Download

Related pages:
* Change log
* Tutorial

Ramon Eijkemans pointed me out to the script written by the Stuart Langridge. This bland sorting table script was very awesome, offering a different sort of mechanisms for the text, numbers, dates as well as currencies, by just adding the outside script to the page and the class on a table!

However, it is short of a few things, nearly all importantly: hold up for exchange row classes. Operating on it additional, I found there was some bug to it too. So I began adapting it. In the beginning there were now a few altars. Now more and more of e-mails with mark requests are impending in, and I have began versioning my sorting table script.

Tags:

Эта статья была опубликована на25 May 2008на12:04 AM в категории Web Design. Вы можете следить за обновлениями в этой статье с помощьюRSS 2.0фидов. Вы можете оставить ответ, или обратную ссылку из ваше сайте.

Оставить отзыв

Name (*)
Mail (will not be published) (*)
URI
Комментарий