Header colspan in options

Header colspan in options

lucas_araujolucas_araujo Posts: 12Questions: 5Answers: 0

I just migrated my code to Vue and am using the DataTables component like this:

<CustomDataTable
      v-if="tableData.length > 0"
      :data="tableData"
      :columns="tableColumns"
      ref="dataTableRef"
 />

But i have not found a way to use a ComplexHeader with this method, is there a way?

My objective:

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948

    I assume you are using columns.title to create the header. This only supports a single header row. From the columns.title docs:

    Please note that when constructing a header, DataTables can only construct a simple header with a single cell for each column. Complex headers with colspan and rowspan attributes must either already be defined in the document, or be constructed using standard DOM / jQuery methods.

    Kevin

  • allanallan Posts: 63,485Questions: 1Answers: 10,467 Site admin
    Answer ✓

    If you were to use our Vue component you can pass a thead in to the DataTable component as the default slot, and it will use that as the table header.

    Allan

Sign In or Register to comment.