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.
- Choose alignmentLeft for text-heavy tables, right for numbers/prices, centre for short labels.
- Copy the CSSApplies padding too, for breathing room inside each cell.
- 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.
| A | B |
|---|---|
| 1 | 2 |
3Browser Compatibility
| Browser | Support | Notes |
|---|---|---|
| Chrome | ✓ Supported | Full support |
| Firefox | ✓ Supported | Full support |
| Safari | ✓ Supported | Full support |
| Edge | ✓ Supported | Full support |
| Opera | ✓ Supported | Full support |
| Mobile browsers | ✓ Supported | Full 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.