Solved

CSS setting table bgcolor?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

762 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

22 Experts available now in Live!

Get 1:1 Help Now