Home

tbody

tbody is an HTML element that groups the body content of a table. It contains row elements (tr), which in turn contain data cells (td) or header cells (th). The element works together with thead and tfoot to separate the table's header, body, and footer. Semantically, tbody marks the portion of the table that holds the main data, distinguishing it from header rows and footer rows.

Multiple tbody sections are allowed inside a single table. This enables grouping of related rows—for example,

A browser may automatically generate an implicit tbody if rows are present without an explicit tbody tag.

Styling and scripting often target tbody to apply styles to the table body, such as zebra striping

to
apply
different
styling
to
different
data
blocks,
or
to
facilitate
dynamic
updates
via
scripts.
Thead
and
tfoot
are
typically
used
once
per
table,
while
one
or
more
tbodys
may
appear.
The
tbody
element
itself
is
a
container;
it
does
not
inherently
affect
layout
beyond
what
CSS
applies.
The
default
display
value
is
table-row-group,
which
influences
how
browsers
render
borders
and
backgrounds
for
the
group
of
rows.
or
scrolling
effects.
For
accessibility,
pair
thead
with
th
cells
and
use
scope
attributes
or
the
headers/
id
relationships
so
screen
readers
can
map
data
cells
to
headers.