Untitled

 avatar
unknown
plain_text
5 months ago
1.9 kB
3
Indexable
// Función para crear subtabla
function createNestedTable(details, index) {
  const backgroundColors = ['#4F378A14', '#4F378A29', '#4F378A1F'];
  const style = document.createElement('style');
  style.innerHTML = `
  .header-background {
    background-color: ${backgroundColors[0]};
    padding: 20px 10px 20px 15px; /* Ajusta los márgenes */
    text-align: left;
    line-height: 1;
    font-family: Inter, sans-serif;
    font-weight: normal;
    color: #12385C;
    display: flex;
    align-items: center; /* Alinea el contenido verticalmente */
    justify-content: flex-start; /* Alinea el texto a la izquierda */
    white-space: nowrap; /* Evita el salto de línea */
    overflow: hidden; /* Oculta el contenido desbordado */
    text-overflow: ellipsis; /* Agrega puntos suspensivos si el contenido no cabe */
  }
  .header-background-2 {
    background-color: ${backgroundColors[1]};
    padding: 20px 10px 20px 15px;
    text-align: left;
    line-height: 1;
    font-family: Inter, sans-serif;
    font-weight: normal;
    color: #12385C;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-background-3 {
    background-color: ${backgroundColors[2]};
    padding: 20px 10px 20px 15px;
    text-align: left;
    line-height: 1;
    font-family: Inter, sans-serif;
    font-weight: normal;
    color: #12385C;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
`;
document.head.appendChild(style);

  const MIN_ROWS = 8;
  const ROW_HEIGHT = 43;
  const HEADER_HEIGHT = 40;

  const adjustedDetails = Array.isArray(details) ? [...details] : [];
  while (adjustedDetails.length < MIN_ROWS) {
    adjustedDetails.push({});
  }
Editor is loading...
Leave a Comment