Solved

CSS setting table bgcolor?

Posted on 2008-10-22
3
495 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
[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 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

Independent Software Vendors: 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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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?
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
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