This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > June 2004 > encapsultating TABLE attributes in CSS





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author encapsultating TABLE attributes in CSS
Roedy Green

2004-06-23, 11:15 pm

I have a table style like this:
table.gridmenu /* tables used for creating menus of clickable buttons
*/ {
background : #fbf4d8;
color : #0080ff;
font : 80% Arial,Helvetica,sans-serif;
}

When I use it I add some extra stuff like this:

<table border="7" cellpadding="10" class="gridmenu" >

I have horsed around but can't seem to figure out what to do to the
table.gridmenu or a td.gridmenu style to build in the border and
cellpadding.

I wonder if the problem is I need to individually add the gridmenu
attribute to every ruddy cell. Surely not!
Andrew Urquhart

2004-06-23, 11:15 pm

*Roedy Green* wrote:
> I have a table style like this:
> table.gridmenu /* tables used for creating menus of clickable buttons
> */ {
> background : #fbf4d8;
> color : #0080ff;
> font : 80% Arial,Helvetica,sans-serif;
> }
>
> When I use it I add some extra stuff like this:
>
> <table border="7" cellpadding="10" class="gridmenu" >
>
> I have horsed around but can't seem to figure out what to do to the
> table.gridmenu or a td.gridmenu style to build in the border and
> cellpadding.
>
> I wonder if the problem is I need to individually add the gridmenu
> attribute to every ruddy cell. Surely not!


Don't forget that you can additionally specify:

table.gridmenu td {
padding: 10px;
border: 7px;
border-collapse: collapse;
/* etc. */
}

Is this what you were looking for?
--
Andrew Urquhart
- FAQ: www.css.nu/faq/ciwas-aFAQ.html
- Archive: www.tinyurl.com/ysjbm (Google Groups)
- My reply address is invalid, use: www.andrewu.co.uk/contact/


Roedy Green

2004-06-23, 11:15 pm

On Thu, 24 Jun 2004 01:18:52 +0100, "Andrew Urquhart"
<useWebsiteInSignatureToReply@spam.invalid> wrote or quoted :

>table.gridmenu td {
> padding: 10px;
> border: 7px;
> border-collapse: collapse;
> /* etc. */
>}
>
>Is this what you were looking for?


I tried various permutations of table gridmenu and td, with and
without dots. Perhaps that one is the key. Thanks.

I think I suddenly get how it works.


--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Andrew Thompson

2004-06-23, 11:15 pm

On 23 Jun 2004 16:40:07 -0700, Roedy Green wrote:

> I have a table style like this:
> table.gridmenu /* tables used for creating menus of clickable buttons
> */ {
> background : #fbf4d8;
> color : #0080ff;
> font : 80% Arial,Helvetica,sans-serif;
> }


You mean this one?
<http://mindprod.com/jgloss/css.html>

You can apply a style to any child
element of table represented by..
<table class="gridmenu" border="0" cellspacing="4" cellpadding="4">
...ask the CSS experts how.

It might pay to lose the..
[ .. border="0" cellspacing="4" cellpadding="4".. ]
...though.

HTH

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Roedy Green

2004-06-24, 4:15 am

On Thu, 24 Jun 2004 01:05:07 GMT, Andrew Thompson
<SeeMySites@www.invalid> wrote or quoted :

>It might pay to lose the..
>[ .. border="0" cellspacing="4" cellpadding="4".. ]
>..though.


Ok, I am cooking now thanks to your help.

table.gridmenu td /* tables used for creating menus of clickable
buttons */ {
border-style : outset;
border-width : 2px;
border-color: #808080;
padding : 5px;
margin : 5px;
}

works fine, except the margin command seems to be ignored. I am using
Opera 7.5. It acts as if margin=1px no matter what I set it to.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
David Dorward

2004-06-24, 7:22 am

Roedy Green wrote:

> works fine, except the margin command seems to be ignored. I am using
> Opera 7.5. It acts as if margin=1px no matter what I set it to.


Table cells don't have margins. Look up "border-spacing" (as applied to the
<table> ).


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Wolfgang Wildeblood

2004-06-24, 12:16 pm

Roedy Green <look-on@mindprod.com.invalid> wrote:

> On Thu, 24 Jun 2004 01:05:07 GMT, Andrew Thompson
> <SeeMySites@www.invalid> wrote or quoted :
>
>
> Ok, I am cooking now thanks to your help.
>
> table.gridmenu td /* tables used for creating menus of clickable
> buttons */ {
> border-style : outset;
> border-width : 2px;
> border-color: #808080;
> padding : 5px;
> margin : 5px;
> }
>
> works fine, except the margin command seems to be ignored. I am using
> Opera 7.5. It acts as if margin=1px no matter what I set it to.


border-collapse: separate;
border-spacing: 4px;

--
Roedy Green

2004-06-24, 7:17 pm

On 24 Jun 2004 06:03:41 -0700, wolfgangwildeblood@yahoo.com.au
(Wolfgang Wildeblood) wrote or quoted :

>
> border-collapse: separate;
> border-spacing: 4px;


Thanks. All is behaving now. These work, but they have to go on the
table not the td.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews