Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
Tabulator custom formatter breaks cell height

I've encountered a weird issue in Tabulator where the cell heights are very small when all columns are using a custom formatter.

See this fiddle: https://jsfiddle.net/LukeAtkinsFNM/soLk5p0x/11/

The two formatters I'm using are a float formatter and a luxon DateTime formatter. They each return a string value.

Tabulator.extendModule("format", "formatters", {

    float: (cell, params, onRendered) => {
        var val = cell.getValue();
        if (val === null || val === undefined || isNaN(Number(val))) return "";
        if (params.showZeros !== undefined) {
            if (!params.showZeros && val == 0) return "-   ";
        }
        var text = Number(val).toLocaleString("en-AU", {
            notation: "standard",
            minimumFractionDigits: params.digits || 2,
            maximumFractionDigits: params.digits || 2,
        });
        if (params.units) text += " " + params.units;
        return text;
    },

    DateTime: (cell, params, onRendered) => {
        var dt = cell.getValue();
        if (dt == null) return "";
        if (typeof(dt) == "number" || !isNaN(dt)) dt = DateTime.fromMillis(Number(dt));
        if (!dt.toFormat) return dt.toString();
        if (!params.format) params.format = "yyyy-MM-dd hh:mm";
        var text = dt.toFormat(params.format);
        return text;
    },

});

Rows with complete data seem fine, but when I add a blank row, the row height is correct, but the cell heights are tiny which causes issue when using the cell editors.

If I add a blank column it seems to fix the issue, but it's not a desirable solution. Does anyone have any ideas?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is happening because your formatters are returning empty space if the cell is empty.

Formatters should return a non breaking space if they are empty  

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda