How to export datatable in pdf and set table headers horizontally.

How to export datatable in pdf and set table headers horizontally.

user01user01 Posts: 4Questions: 2Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Hello, I want to know how to set the data table column horizontally in pdf.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Do you mean you want to twist the table, so the headers are vertical? If so, that would need a reformatting of the data. This thread shows how to get the data from the server (so nothing like what you want), but it does show how you can manipulate the data for the export functions.

    Colin

  • user01user01 Posts: 4Questions: 2Answers: 0
    edited May 2021

    hi @colin,
    when I export data in pdf then the table will look as follow
    ID Name Age City
    1 A 25 C1
    2 B 26 C2

    but I want to show the following format when data exported in a pdf file.

    ID 1 2
    Name A B
    Age 25 26
    City C1 C2

    can we do this ?

  • allanallan Posts: 63,573Questions: 1Answers: 10,483 Site admin
    Answer ✓

    Sorry no - that is not something that DataTables supports at this time.

    Allan

  • user01user01 Posts: 4Questions: 2Answers: 0

    Okay.Thank you @allan

This discussion has been closed.