Skip to content

Instantly share code, notes, and snippets.

@tswaters
Created December 4, 2021 03:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tswaters/0a12b4a18f37cc7d05ba0d6eb298a035 to your computer and use it in GitHub Desktop.
HOW TO: center text
<!DOCTYPE html>
<html>
<head>
<title>How to center text</title>
<meta charset="utf-8" />
</head>
<body>
<table style="width: 100%; height: 100%; position:absolute;">
<tr>
<td valign="middle" align="center">
center me!
</td>
</tr>
</table>
</body>
</html>
@tswaters
Copy link
Author

tswaters commented Dec 4, 2021

It's an older code, sir but it checks out

@tswaters
Copy link
Author

tswaters commented Dec 4, 2021

Actually, you can omit valign="middle" because it's the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment