Solved

How do I make a table left align in css?

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now