Change Text Size in DataTable

Change Text Size in DataTable

zgoforthzgoforth Posts: 493Questions: 98Answers: 2

I know this is probably accomplishable through CSS which I may have to end up doing, but is there a a way through DataTables where I can edit the font size displayed within the table?

I know that it is posted within a <td> element, but so are the parent rows, and I just want to edit the size of the text in the child row
https://jsfiddle.net/msbgh0yu/

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin
    Answer ✓

    CSS is how you would do it.

    Each row which is added by RowGroup has a dtrg-level-{i} class (where {i} is the nesting level - e.g. 0, 1, 2, etc).

    So you would set your table font-size:

    table.dataTable td {
      font-size: 1em;
    }
    

    And then use the RowGroup classes to change the font-size of the rows it adds:

    table.dataTable tr.dtrg-level-0 td {
      font-size: 1.1em;
    }
    

    for example.

    Allan

  • zgoforthzgoforth Posts: 493Questions: 98Answers: 2

    @allan Thanks!

This discussion has been closed.