Solved

CSS setting table bgcolor?

Posted on 2008-10-22
3
472 Views
Last Modified: 2012-05-05
I'm trying to change my old HTML code to XHTML Strict with CSS (begining with it), I dont know much about CSS yet, how do i set the next HTML simple code (a table bgcolour and some other attributes) using CSS??

I have this:

<table width="1000px" border=0 bgcolor="232323" align="center">

I want those attributes in css
0
Comment
Question by:axtur
3 Comments
 
LVL 4

Accepted Solution

by:
Jerrod_W earned 300 total points
ID: 22782128
You could create a class, and assign that class to the table properties. Look at the attached for the CSS. Follow in the html, define the table as follows:

<TABLE class="mytable">

See if that works for you.
.mytable{

width: 1000px;

background-color: #232323;

border-style: none;

margin-left: auto;

margin-right: auto;

}

Open in new window

0
 
LVL 1

Assisted Solution

by:nick_bal
nick_bal earned 200 total points
ID: 22782213

<style>

.mytable{ 

width:1000px; 

background:#232323; 

border:none;

text-align:center;

} 

</style>
 

<table class="mytable">

<tr><td>This is a table</td></tr>

</table>

Open in new window

0
 

Author Closing Comment

by:axtur
ID: 31509006
Very helpful to begin with, thank you!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help in CSS 5 45
SharePoint 2013 Searchbox Branding 11 33
Box Model and Styling 12 34
Help cleaning out CSS 2 50
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…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
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…

943 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

19 Experts available now in Live!

Get 1:1 Help Now