• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Center align form elements in css

How do I do this?

In the "olden days", you just said <td align="center"> & everything is center aligned.
0
Richard Korts
Asked:
Richard Korts
1 Solution
 
CKY092Commented:
If you're using CSS, it'd look like:

td{
    text-align: center;
}

Open in new window

0
 
WizardOfOgzCommented:
I'd recommend you add a class to your table, e.g.
<table class="my-table"...</table>

Open in new window

.

Then you can add a CSS rule to center content in the TD's:

.my-table td {
  text-align: center;
}

Open in new window

0
 
Richard KortsAuthor Commented:
That's exactly what I had; EXCEPT I closed it (accidentally) with ) instead of }.

You got 500 easy points; that part now works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now