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

100
Vistas
Is there a way where I could put a line break for each data it displays?

I have this array and I can already display it on the screen. I'm wondering if I can put a line break for each of the data it displays.

{
      name: "cartItems",
      label: "Product Name",
      options: {
        filter: true,
        sort: true,
        customBodyRender: (value, tableMeta, updateValue) => {
          // console.log(value, "cartItems");
          return value.map(
            (value) =>
              value.name +
              " (" +
              value.color +
              ") - " +
              " Qty:" +
              value.quantity +
              ","
          );
        }
      }
    }

As of now, it displays in one line like this:

Item name (item color) - Qty: 1 Item name (item color) - Qty: 2 Item name (item color) - Qty: 2

I wanted to somehow display it like this:

Item name (item color) - Qty: 1
Item name (item color) - Qty: 2
Item name (item color) - Qty: 2

Is this possible?

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

0

Try to add \n

          return value.map(
            (value) =>
              value.name +
              " (" +
              value.color +
              ") - " +
              " Qty:" +
              value.quantity +
              "," + 
              "\n"
          );
        
about 4 years ago · Juan Pablo Isaza Denunciar

0

Try this :

return value.map((value) => `${value.name} (${value.color}) - Qty: ${value.quantity}, 
`);
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