Solved

How do I make a table left align in css?

Posted on 2011-03-10
5
278 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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…

726 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