Tabulator: css height game

Created on 1 Jul 2017  路  4Comments  路  Source: olifolkerd/tabulator

image

I am trying to bring the text and the image to
be nicely aligned vertically but no matter what
I specify in height of the cell and the raw, I can't
change it. Please advice.

Question - Ask On Stack Overflow

All 4 comments

Hey,

They height of the cells is automatically adjusted by Tabulator to ensure they are all the same height, so any changes you have made to the height will be overwritten.

If your content is always the same height, then you could adjust the padding of the cells to move the text down.

Alternatively you could use a custom formatter to put all the cells content in another div, and then set the following css properties on the cells to turn them into flex boxes allowing for automatic vertical centering:

display:inline-flex;
align-items:center;

Let me know if that helps,

Cheers

Oli

Yep it worked, 10x. 馃

which option did you go for out of curiosity?

image

custom{
  padding-top: 5px;
  display:inline-flex;
  align-items:center;
 }
 {title:"Host", field:"host", sorter:"string", width:80, headerFilter:"input", 
 formatter:function(value){return "<div class='custom'>" + value + " </div>" }},
Was this page helpful?
0 / 5 - 0 ratings

Related issues

c3pos-brother picture c3pos-brother  路  3Comments

andreivanea picture andreivanea  路  3Comments

alainpannetier picture alainpannetier  路  3Comments

mohanen picture mohanen  路  3Comments

soo1025 picture soo1025  路  3Comments