Table Code

HTML Table Text Alignment Code

Control how text sits inside each cell — alignment, padding and weight.

Live Tool
table-align.css Live

          
Preview

1How To Use

Follow these steps — no coding experience needed.

  1. Choose alignmentLeft for text-heavy tables, right for numbers/prices, centre for short labels.
  2. Copy the CSSApplies padding too, for breathing room inside each cell.
  3. Mix per-columnTarget a specific column with :nth-child() if you need different alignment per column.

2Example Output

What this code looks like once it's on a real page.

AB
12

3Browser Compatibility

BrowserSupportNotes
Chrome✓ SupportedFull support
Firefox✓ SupportedFull support
Safari✓ SupportedFull support
Edge✓ SupportedFull support
Opera✓ SupportedFull support
Mobile browsers✓ SupportedFull support, iOS & Android

Supported in every current browser — Chrome, Firefox, Safari, Edge and Opera all render this identically, on both desktop and mobile.

Related Pages

More tools that pair naturally with this one.