[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Center align form elements in css

Posted on 2011-10-13
3
Medium Priority
?
189 Views
Last Modified: 2012-05-12
How do I do this?

In the "olden days", you just said <td align="center"> & everything is center aligned.
0
Comment
Question by:Richard Korts
3 Comments
 
LVL 4

Accepted Solution

by:
CKY092 earned 2000 total points
ID: 36965516
If you're using CSS, it'd look like:

td{
    text-align: center;
}

Open in new window

0
 
LVL 2

Expert Comment

by:WizardOfOgz
ID: 36965523
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
 

Author Closing Comment

by:Richard Korts
ID: 36965560
That's exactly what I had; EXCEPT I closed it (accidentally) with ) instead of }.

You got 500 easy points; that part now works.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question