Table Component

Axiom01 provides clean, semantic, and responsive styling for HTML tables, ensuring tabular data is presented clearly and accessibly. Our table component focuses on readability and maintainability without excessive class usage.

Live Example

Basic Table

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

Striped Table

Product Quantity Price
Axiom T-Shirt 2 $29.99
Axiom Mug 1 $14.50
Axiom Sticker Pack 3 $7.00

HTML Structure

Axiom01 styles standard HTML <table> elements. No special classes are needed for basic table styling, promoting semantic HTML.

<!-- Basic Table -->
	<table>
			<thead>
					<tr>
							<th>#</th>
							<th>First Name</th>
							<th>Last Name</th>
							<th>Username</th>
					</tr>
			</thead>
			<tbody>
					<tr>
							<td>1</td>
							<td>Mark</td>
							<td>Otto</td>
							<td>@mdo</td>
					</tr>
					<tr>
							<td>2</td>
							<td>Jacob</td>
							<td>Thornton</td>
							<td>@fat</td>
					</tr>
			</tbody>
	</table>

	<!-- Striped Table -->
	<table class="striped">
			<!-- ... table content ... -->
	</table>

Styling

Axiom01 applies default styles to <table>, <th>, and <td> elements. For variations, a minimal class approach is used:

Responsive Tables

For tables that may contain many columns and overflow on smaller screens, wrap the table in a container with overflow-x: auto; to enable horizontal scrolling.

<div style="overflow-x: auto;">
			<table>
					<!-- ... wide table content ... -->
			</table>
	</div>

Accessibility

Tables are inherently accessible when structured correctly:

Customization

Customize the appearance using Axiom01's CSS variables for colors (e.g., --a-color-outline for borders, --a-color-surface-variant for striped rows), spacing, and typography. You can also add custom classes for more specific table variations.