Newbie need sample code
Newbie need sample code

Could someone give sample file for creating table datatables. I am confused where to put the javascript code & do i really need server to test or could I just test it locally using html code?
It would be great if someone could post the project html sample file which used it.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The simplest example has all the code you need to get started:
https://datatables.net/examples/basic_init/zero_configuration.html
I already tried it referring that but. does not work.. There is no html, head & body tag in example.
I dont want bits & pieces of code.. I want a complete source code file sample.
Where to place the javascript code in html. above table or below table. head tag or body tag.. or files... I have downloaded local copies of the css & js & added below 2 lines in head tag.
<link rel="stylesheet" type="text/css" href="/datatables.css">
<script type="text/javascript" charset="utf8" src="/datatables.js"></script>
@tangerine Could you Please send me a working sample file so I can figure out what I am missing or doing wrong.
Why cant these guys give a clear html file with full code sample for zero configuration. Not all who use datatables are pros. Why is everybody in all forums asking me to refer the same link for sample code.. It does not have a workable complete file. Just snippets of javascript & table is given... That does not help me ...
So add them yourself, as appropriate for your environment and personal preferences.
You should also read the installation instructions:
https://datatables.net/manual/installation
If you don't know how to construct a web page, this is not the place to start.
Here is a very basic example. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.
Cheers,
Colin
@colin Many thanks for the live example. This is exactly what I needed. Now following this example my code is working. How did you create your sample page at live.datatables.net ? Do you need any license or subscription to pro version or is it free for me to do some trial scripting. I dont know how to save any changes on it & send you new link, Could you share the link to some documentation around how to do it? I am curious to get my own online workspace... Please Please guide me bro...
@tangerine Thanks for replying you my query & guiding me with your valuable time. I found my issue after looking at colins example. the *.js files were not loaded in my env correctly due to wrong path & missing js. Both of you are doing gr8 community service by helping people like me... Appreciate your inputs.
@colin
Now you gave me information on another gr8 feature of datatables which I found on this link after doing a bit of digging.. Please share other tools & features which would be handy & useful for me trying out datatables for my webpage.. I feel I have lots to learn from you ....
Using JS Bin
Actually using JS Bin is very simple; simply load http://live.datatables.net in your browser and start customising the HTML / Javascript / CSS as required. The buttons at the top of the browser window allow you to select what code is shown, and an option to see the final output.
To share a created bin click the Share menu at the top of the browser window and copy the URL shown. Add that URL to your forum post, e-mail or otherwise share it and other developers will be able to review your example.
It's free. I would suggest reading the manual and the reference pages, and look at the running examples. All the information you need will be there.
Colin