tableCell function

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

Semantic <td> table data cell element.

Implementation

BloomNode tableCell({
  String? text,
  List<BloomNode>? children,
  String extraClassName = '',
  int? colSpan,
  int? rowSpan,
}) {
  return El(
    'td',
    attrs: {
      if (colSpan != null) 'colspan': '$colSpan',
      if (rowSpan != null) 'rowspan': '$rowSpan',
    },
    className: cn(['p-4 align-middle whitespace-nowrap text-xs sm:text-sm', extraClassName]),
    children: [
      if (text != null) Text(text),
      if (children != null) ...children,
    ],
  );
}