Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 09-26-2011, 09:17 AM Using Datatables...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Hi,

Can someone help me get a basic datatable to function?

For the life of me, I can't get this code working at all. Coding has been by far having it's way with me...For at least the past 6 months

Ok, anyway...Here's the code I have on my page:

HTML Code:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>          

<script type="text/javascript">

$(document).ready(function() {
$('#test').dataTable( {
"sPaginationType": "full_numbers"
} );

</script>



</head>

<table id="test">

<thead>
		<tr>
			<th>Column 1</th>
			<th>Column 2</th>
			<th>Column 3</th>
		</tr>
</thead>

<tbody>
		<tr>
			<td>Row 1</td>
		</tr>
		
                <tr>
			<td>Row 2</td>
		
		</tr>

                <tr>
			<td>Row 3</td>
		
		</tr>

</tbody>
</table>
The output I am getting is on this page: http://reunitemysite.com/datatables/datatables.html

Thanks again!
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-26-2011, 01:30 PM Re: Using Datatables...
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Not sure I'm understanding the full problem but the basic HTML is wrong. You have three TH's so there should be three TD's per row (in the absence of colspans).
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Old 09-26-2011, 02:37 PM Re: Using Datatables...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by PaulW View Post
Not sure I'm understanding the full problem but the basic HTML is wrong. You have three TH's so there should be three TD's per row (in the absence of colspans).
Not according to this page:
http://www.datatables.net/usage/
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 09-26-2011, 02:54 PM Re: Using Datatables...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by Brian07002 View Post
Not according to this page:
http://www.datatables.net/usage/
Their example has three th elements per row AND three td elements per row.

A th element is a tablular column heading cell and a td is a tabular column data cell, so there should be an matching number of th & td elements per row.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 09-26-2011 at 02:55 PM..
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-26-2011, 03:08 PM Re: Using Datatables...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Their example has three th elements per row AND three td elements per row.
I just copied and pasted their exact code on the usage page into my page, and don't get the jquery output. Any ideas?
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 09-26-2011, 04:23 PM Re: Using Datatables...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
No idea, never used jquery, never likely to.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-26-2011, 09:52 PM Re: Using Datatables...
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Quote:
Originally Posted by Brian07002 View Post
Not according to this page:
http://www.datatables.net/usage/
That page says " the HTML for the target table must be laid out in a well formed manner " - I refer you to the answer I gave earlier! "Well formed" means syntactically correct.

The code you're trying to use essentially just puts data into corresponding slots. It requires the data to be laid out with the same grid pattern that the table has (or vice versa to be strictly accuarate).
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE

Last edited by PaulW; 09-26-2011 at 10:00 PM..
PaulW is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to Using Datatables...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19163 seconds with 12 queries