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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First attempt using Class 2

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
Good Morning,

I'm trying to create a simple class for the <Table> element. All I'm trying to do is copy the same style you get when you take data from an Excel spreadsheet and dump it into Front Page. What I've tried so far:
Code:
<style type=&quot;text/css&quot;>
	.DataTable {font size: 12; font-type:&quot;Arial&quot;; border:&quot;1&quot;; bgcolor:&quot;#ffffff&quot;; cellspacing:&quot;0&quot;; bordercolor:&quot;#808080&quot;}
	.DataTableHeader {bgcolor:&quot;#c0c0c0&quot; ; BORDERCOLOR:&quot;#000000&quot;;font size: 12; font-type:&quot;Arial&quot;; }            
</style>
...

<table width=&quot;100%&quot; class=&quot;DataTable&quot;>
  <th width=&quot;33%&quot; class=&quot;DataTableHeader&quot;>Required</th>
...

The font size and type work but the bgcolor and border size, and border color does not. Can anyone help me here?

Thanks,
Rewdee
 
Hi Rewdee,
you don't have to use quotes (&quot;) in the style and there are a lot of wrong syntaxes:

So try this (and see the differences if you change some values):

<style type=&quot;text/css&quot;>
.DataTable {font-size: 12px; font-family:Arial; border:solid 2px #01A2D7; background-color:#f5f5ff; padding:0px;}
.DataTableHeader {background-color:#FCFF0F ; border:solid 1px #FF0000; font-size: 9px; padding:15px; font-family:Times New Roman; }
</style>

Here is a great site to learn CSS-syntaxes:


Hope this helps,
Erik <!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Your code in incorrect.
I'd recommend you check out the W3C's CSS pages.

Anyway in brief it's

{ background: #ffffff; etc }
and for border you need to specify:
{ border-style: solid; border-width: 1px; border-color: #808080 }

You can have different border styles/widths/colours etc etc

If you want to specify different borders on the same table you need:

{border-top-style: ; border-top-width: ; border-top-color: ;
border-left-style: ; border-left- etc etc }

you need to do some reading :))

É
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top