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

301
Vistas
How to determinate the width value based on the font size and a box size?

My codes in Vue, creates a tree where each node looks like:

enter image description here

As you can see, it's creates those dots at the end because I use white-space: nowrap;. I pass the component the whole data from the parent component. I want to be able to add a field which represents the maximum number of chars in all nodes (for example if one have name of "abc" and other have "abcd" so it will pass the value 4). I want to set the length of all the nodes, based on that value. The font size is 12px and the block CSS looks like:

.orgchart .node .title {
    transform: rotate(-90deg) translate(-40px, -40px) rotateY(180deg);
    transform-origin: bottom center;
    width: 120px;
}

As you can see, it's currently 120px. How can I replace this value with a calculated value? In other words, given the maximum value, how can I calculate width?

about 4 years ago · Juan Pablo Isaza
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