Solved

How do I make a table left align in css?

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Divi Them Help with Full Width header 20 64
manage footer size 4 51
Set differnt row widths in a table. 3 21
maps stopped work unsure why 7 34
This article discusses four methods for overlaying images in a container on a web page
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

776 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