Column names from column.name

Column names from column.name

moose56moose56 Posts: 7Questions: 3Answers: 0

Hi,

Currently I am specifying my table HTML to include the column headers like this:

<table>
    <thead>
        <tr>
            <th>ID</th>
            <th>Title</th>
        </tr>
    </thead>
    <tbody>
    </tbody>
</table>

If I only specify and empty table tag DataTables does the work of creating the correct mark up within the table based on the columns option apart from setting the column name. Is this possible? Is there a property from column that I have missed? columns.name does not seem to do this, should it?

Thanks,

David.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    I think you want columns.title rather than columns.name. The name option isn't used by the end user interface at all and is only really useful for a selector. The title option sets the visible title.

    Allan

  • moose56moose56 Posts: 7Questions: 3Answers: 0

    How did I manage to miss that option!!

    Thanks Allan.

This discussion has been closed.