How can I set the height of a data-table-column?

How can I set the height of a data-table-column?

ArcadeArcade Posts: 3Questions: 2Answers: 0
edited May 2018 in Free community support

I've been trying out DataTables.net and I followed this example: https://www.npmjs.com/package/angular-4-data-table . Here you can see some code like :

<

div id="dataTableDiv" *ngIf="tableResource !== undefined;else waitingText">
<data-table id="eaditemsGrid"
headerTitle="EAD Process items"
[items]="items"
[itemCount]="itemCount"
(reload)="reloadItems($event)"

    (rowClick)="rowClick($event)"
    (rowDoubleClick)="rowDoubleClick($event)"
    [rowTooltip]="rowTooltip"
    >
    <data-table-column
        [property]="'id'"
        [header]="'id'"
        [sortable]="true"
        [resizable]="true"
        [width]="300">
    </data-table-column>
>>...  

As you can see "width" is a good property, but "height" not, also trying to change the height of the "tr" in my "dataTableDiv" via css doesn't seem to work... Does anyone have an idea of how I can change the height of each tr or row of data to my own value (like 150 px for example)?

Answers

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

    Hi @Arcade ,

    Have a look at this thread here, there's an example on how to change it in the CSS.

    Cheers,

    Colin

  • ArcadeArcade Posts: 3Questions: 2Answers: 0

    Hi @colin,

    this is what I've tried unfortunately :( and I couldn't get it to work.

    I have something like this:

    #dataTableDiv tbody > tr {
    height: 100px;
    }
    

    or just doing it on "tr" or "#id tbody > tr > td" etc... it all doesn't work and doesn't seem to apply to my html :s !

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

    I just checked your link above, and https://github.com/MIt9/angular-4-data-table-demo is nothing to do with this DataTables I'm afraid, so best to ask on their forum/site.

    Cheers,

    Colin

This discussion has been closed.