TanStackT
TanStack3y ago
8 replies
endless-jade

Dynamic colspan on table body cell

Is this scenario possible I have a flexible data structure currently trying with type of data

const apiData = [
  {
    initiate_partner_login: { totalAttempts: "1200" },
    partner_login_successfull: {
      totalAttempts: { to_show_past_30days_data: "1100" },
      uniqueAttempts: { to_show_past_30days_data: "1300" },
    },
    partner_subscription: {
      totalAttempts: {
        subscription: "500",
        linking_only: "400",
        subscription_failed: "50",
      },
      uniqueAttempts: {
        subscription: "300",
        linking_only: "300",
        subscription_failed: "100",
      },
    },
    linking_sucessfull: {
      totalAttempts: { subscription: "400", linking_only: "300" },
      uniqueAttempts: { subscription: "250", linking_only: "250" },
    },
    subscription_activated: {
      totalAttempts: { subscription: "200" },
      uniqueAttempts: { subscription: "150" },
    },
  },
  {
    partner_subscription: {
      totalAttempts: "950",
      uniqueAttempts: "700",
    },
    linking_sucessfull: {
      totalAttempts: "700",
      uniqueAttempts: "500",
    },
  },
]


I have total attempts as object and for second row it is a string to according to table ui is there a way I can achieve this using the react table or custom functionality will be applied
Screenshot_2023-08-30_at_11.49.42_AM.png
Was this page helpful?