How to get a specifically column by its id?

How to get a specifically column by its id?

prox108prox108 Posts: 17Questions: 8Answers: 0
edited January 25 in Free community support

Hi guys!,

Currently I capture columns to export like this:


            extend: 'excel',

            title: 'Report',

                 columns: [':visible :not(:first-child,:nth-child(6))']

As you see I only export columns currently visible excepting the first one and the sixth column.

Unfortunately this sixth column is dynamic, meaning it can be in another places sometimes, like in tab 1 it is the sixth, but in tab 2 it is the eight.

Do you know How can I get this column by its id in order to add it to my :not:() function?


  • allanallan Posts: 62,469Questions: 1Answers: 10,258 Site admin

    You could add an id to the th in the header for that column and then use #myId as the selector. See also Kevin's reply in your other thread on this topic.


  • kthorngrenkthorngren Posts: 20,791Questions: 26Answers: 4,860

    This example states that you can use any mix of column-selector options. You should be able to add the column ID to the array, like this:

    columns: [':visible :not(:first-child,:nth-child(6))', '#myColumn']


Sign In or Register to comment.