% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tables.R
\name{build_table_if_available}
\alias{build_table_if_available}
\title{Build a table if indicator is available}
\usage{
build_table_if_available(
  ind_list,
  total_key,
  by_sex_key,
  by_age_key,
  label,
  pct = TRUE
)
}
\arguments{
\item{ind_list}{Indicator list (e.g., \code{indicators$tobacco}).}

\item{total_key}{Name of total estimate element (e.g., "current_tobacco_total").}

\item{by_sex_key}{Name of by-sex element (e.g., "current_tobacco_by_sex").}

\item{by_age_key}{Name of by-age element (e.g., "current_tobacco_by_age").}

\item{label}{Table caption.}

\item{pct}{Logical; format as percent? (default TRUE).}
}
\value{
A flextable object or NULL if not available.
}
\description{
Wrapper that safely builds a table only if the required indicator elements exist.
Catches and reports errors gracefully.
}
\keyword{internal}
