tableHead function

BloomNode tableHead({
  1. String? text,
  2. List<BloomNode>? children,
  3. String extraClassName = '',
  4. int? colSpan,
  5. int? rowSpan,
})

Semantic <th> table header cell element.

Implementation

BloomNode tableHead({
  String? text,
  List<BloomNode>? children,
  String extraClassName = '',
  int? colSpan,
  int? rowSpan,
}) {
  return El(
    'th',
    attrs: {
      if (colSpan != null) 'colspan': '$colSpan',
      if (rowSpan != null) 'rowspan': '$rowSpan',
    },
    className: cn([
      'h-10 px-4 text-left align-middle font-medium text-[var(--text-muted)] whitespace-nowrap text-xs sm:text-sm',
      extraClassName,
    ]),
    children: [
      if (text != null) Text(text),
      if (children != null) ...children,
    ],
  );
}