Apply table to a semantic <table> for baseline styling. Enhance with table-striped, table-hover, table-bordered, and responsive wrappers table-responsive.
Structure and scope
Use proper <thead>, <tbody>, and scope="col" on headers—Bootstrap styles do not replace HTML table semantics. For dense admin UIs, table-sm reduces padding.
Important interview questions and answers
- Q: Why wrap tables in table-responsive?
A: Enables horizontal scroll on narrow viewports instead of squashing columns or breaking layout. - Q: When not use a table?
A: Pure layout or single-column lists—use grid or list-group; tables are for tabular data.
Self-check
- Which class adds zebra striping?
- What wrapper fixes overflow on mobile?