Solved

How do I make a table left align in css?

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
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…
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…

688 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