Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table design - making columns differently aligned

Status
Not open for further replies.

sorenbruun

Technical User
Mar 29, 2011
2
NL
Hi, I am trying to create a table in HTML and style it in CSS. I am trying to make the first column in this table ( left aligned and the subsequent 5 columns center aligned.
I have tried to make a class (td class="navn"), but it seems to be overruled by something else - anyway it is not working.

Any ideas on how I get this to work ?

If you have any doubts at this stage - yes, I am a total n00b :)
 
Its called Specificity you akasse td style is more specific and thus more important than your regular td.navn. This means that akasse td{} overrides td.navn{}.

Add the ID to your style, and it should become more specific than your class and thus apply the styling.

Code:
[red]#akasse[/red] td.style{
...
}

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Thank you very much Phil, for the VERY fast reply. It worked like a charm :) Had a feeling the answer was pretty straight forward (when you know how to :) ).
 
This has nothing to do with the solution (since that was already provided in full), but you might want to consider using the semantically more correct <th> for the first column. It is the header column for your table.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top