Zero Configuration problem

Zero Configuration problem

AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0
edited November 2015 in Free community support

Well im just a new guy in the programation world.

i want to use the zero configuration to make a nice table

this is how my html looks like

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sin título</title>
</head>
<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="DataTables/css/jquery.dataTables.min.css">
  
<!-- jQuery -->
<script type="text/javascript" src="DataTables/js/roberto.js"></script>
<script type="text/javascript" src="DataTables/js/jquery.dataTables.min.js"></script>


<!-- DataTables -->
<script type="text/javascript" src="DataTables/js/jquery.dataTables.min.js"></script>
 

<body>

<table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>Name</th>
                <th>Position</th>
                <th>Office</th>
                <th>Age</th>
                <th>Start date</th>
                <th>Salary</th>
            </tr>
        </tbody>
    </table>
    </body>
</html>

I just want to make a table with my hands but with all the style of dthe data table

what i need to place in this function?

$(document).ready(function() {
    $('#example').DataTable();
} );

I place it in my roberto.js inside the js folder

what i need to place in there for it can work.

I REALLY NEED HELP FOR TODAY,

i can type all the data of the table thats not the problem but i cant make it work I DONT KNOW HOW TO MAKE IT WORK

Replies

  • AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0

    WELL i actually use the same you can see in the page:https://www.datatables.net/examples/basic_init/zero_configuration.html

    just help me to make the js pls

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Use formatting first... :) the link on how to do it is below the reply input box.

  • allanallan Posts: 63,760Questions: 1Answers: 10,510 Site admin

    I'm not sure how much more guidance we can give you that then working example that you linked to. Watch specifically don't you understand about that example?

    what i need to place in this function?

    Immediately after you load jQuery and DataTables. If you are new to Javascript, there are a number of tutorials around the web that will help you get started with the language.

    Allan

  • AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0

    i alrady make it work but now i have a issue.

    my table need to be from the number 1 to 700 when i place the first 25 entries, they dont appear in order.

    they apear like this

    ID
    2
    5
    8
    1
    16

    WHY THIS HAPPEN?

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    You peobably have onebof the columns sorted by default... do you see a little blue arrow at the top of one of the cols? Pointing up or down?..

  • allanallan Posts: 63,760Questions: 1Answers: 10,510 Site admin

    Its probably related to non-numeric data in that column, which means it will string sort. Without a link to a test case (which is clearly stated in the forum rules) we cannot say much more than that.

    Allan

  • AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0

    COMPLETED, I LOVE YOU GUYS,the issue come from a space between <td> 1</td and the number

    Now, i need to place this in my wordpress site.

    Can anyone show me a tutorial or tell me how i can make it pls

  • allanallan Posts: 63,760Questions: 1Answers: 10,510 Site admin

    Interesting - DataTables should correctly sort such a column as it trims data read from the DOM. Unless you were Ajax loading the data?

    Have a look at the TablePress plug-in for WordPress which uses DataTables.

    Allan

  • AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0

    I need to try placing it whithout the plug in, my boss say thattome :S

This discussion has been closed.