?
Solved

How do I make a table left align in css?

Posted on 2011-03-10
5
Medium Priority
?
289 Views
Last Modified: 2012-05-11
The table is showing up centered on the page. What should I do to the code below to make the table left justified?
table.somename {}
TR.somename { text-align: center }
TD.somename { }
FONT.somename { COLOR: #cc0000; FONT-FAMILY: Arial,Tahoma,Helvetica,Sans-serif; FONT-SIZE: 14px; font-weight: bold }
FONT.somename { COLOR: #000099; FONT-FAMILY: Arial,Tahoma,Helvetica,Sans-serif; FONT-SIZE: 14px; font-weight: bold }

Open in new window

0
Comment
Question by:varesources
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35100108
change this line
TR.somename { text-align: center }

To this

TR.somename { text-align: left }

Also, I'm not sure but it looks like your style for the table named "somneone" is empty. There is an opening and a closing brace with no code in between.

table.somename {}

Put some styling code inside it. Also, line 5 over rides line 4 as it is the latest command to style your font. Where did you get this whacky CSS from?

0
 
LVL 1

Author Comment

by:varesources
ID: 35100343
Correct me if I am wrong but doesn't text-align: left only justify the text and not the table?

I did not write this and I do not know a whole lot about CSS so I do not know if something is missing or not.
0
 
LVL 20

Accepted Solution

by:
Mark Brady earned 2000 total points
ID: 35100430
Depend on where you put the code. If you want the entire table positioned to the left remove (on your web page NOT in CSS) or add </center> before you put the table in there OR you can add this to the CSS.

postion:relative;
float:left;


that will float your table to the very left or it will float as far left as it can before hitting another <div> tag.

try this

table.somename {
position:relative;
float:left
}
0
 
LVL 1

Author Comment

by:varesources
ID: 35100480
That worked, Thanks!
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35100494
your welcome
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

777 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