Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Using CSS with Grids/Tables

Reply
Thread Tools

Using CSS with Grids/Tables

 
 
tshad
Guest
Posts: n/a
 
      07-07-2006
I am trying to set up various grids with different displays and don't want
to set each row and column individually.

Right now I use the following in my css page:

table {
border-collapse: separate;
border-color:#999999
}
th {
background-color:#000000;
color:white;
text-decoration: none;
border-style:none;
vertical-align:bottom;
font-size:14px;
}
td {
empty-cells: show;
text-align:left;
}

But this sets all the tables in the application the same.

What I am trying to do is something like:

standard.table
standard.td
standard.th
customer.table
customer.td
customer.th
client.table
client.td
client.th

Is there a way to do something like this and just assign one of the 3 to a
particular table using css?

Thanks,

Tom


 
Reply With Quote
 
 
 
 
neilmcguigan@gmail.com
Guest
Posts: n/a
 
      07-07-2006
you can combine css tags like this:

ClassName element { style }

so if your grid has a CssClassName of MyGrid:

MyGrid th { font-family:tahoma }

or even

MyGrid th, MyOtherGrid th { some style }


tshad wrote:
> I am trying to set up various grids with different displays and don't want
> to set each row and column individually.
>
> Right now I use the following in my css page:
>
> table {
> border-collapse: separate;
> border-color:#999999
> }
> th {
> background-color:#000000;
> color:white;
> text-decoration: none;
> border-style:none;
> vertical-align:bottom;
> font-size:14px;
> }
> td {
> empty-cells: show;
> text-align:left;
> }
>
> But this sets all the tables in the application the same.
>
> What I am trying to do is something like:
>
> standard.table
> standard.td
> standard.th
> customer.table
> customer.td
> customer.th
> client.table
> client.td
> client.th
>
> Is there a way to do something like this and just assign one of the 3 to a
> particular table using css?
>
> Thanks,
>
> Tom


 
Reply With Quote
 
 
 
 
tshad
Guest
Posts: n/a
 
      07-11-2006
Would each of the tags have to have a "." on them?

For example:

..MyGrid table {border-color:#2f2f2f}
..MyGrid th { font-family:tahoma }
..MyGrid td {text-align:left}

Then do something like:

<aspataGrid CssClass="MyGrid" ...

Thanks,

Tom

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> you can combine css tags like this:
>
> ClassName element { style }
>
> so if your grid has a CssClassName of MyGrid:
>
> MyGrid th { font-family:tahoma }
>
> or even
>
> MyGrid th, MyOtherGrid th { some style }
>
>
> tshad wrote:
>> I am trying to set up various grids with different displays and don't
>> want
>> to set each row and column individually.
>>
>> Right now I use the following in my css page:
>>
>> table {
>> border-collapse: separate;
>> border-color:#999999
>> }
>> th {
>> background-color:#000000;
>> color:white;
>> text-decoration: none;
>> border-style:none;
>> vertical-align:bottom;
>> font-size:14px;
>> }
>> td {
>> empty-cells: show;
>> text-align:left;
>> }
>>
>> But this sets all the tables in the application the same.
>>
>> What I am trying to do is something like:
>>
>> standard.table
>> standard.td
>> standard.th
>> customer.table
>> customer.td
>> customer.th
>> client.table
>> client.td
>> client.th
>>
>> Is there a way to do something like this and just assign one of the 3 to
>> a
>> particular table using css?
>>
>> Thanks,
>>
>> Tom

>



 
Reply With Quote
 
neilmcguigan@gmail.com
Guest
Posts: n/a
 
      07-11-2006
not entirely sure what you mean...

a css class when declared in css, needs a "." at the beginning, but not
in the html tag itself

<style>

th {some style}

..SomeClass {some style}

#anID {some style}

</style>

you can refer to the id of an element using #
you can refer to the class of an element using .
you can refer to an element using its tag

in html would be like this:

<th class="SomeClass" id="anID">


tshad wrote:
> Would each of the tags have to have a "." on them?
>
> For example:
>
> .MyGrid table {border-color:#2f2f2f}
> .MyGrid th { font-family:tahoma }
> .MyGrid td {text-align:left}
>
> Then do something like:
>
> <aspataGrid CssClass="MyGrid" ...
>
> Thanks,
>
> Tom
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> > you can combine css tags like this:
> >
> > ClassName element { style }
> >
> > so if your grid has a CssClassName of MyGrid:
> >
> > MyGrid th { font-family:tahoma }
> >
> > or even
> >
> > MyGrid th, MyOtherGrid th { some style }
> >
> >
> > tshad wrote:
> >> I am trying to set up various grids with different displays and don't
> >> want
> >> to set each row and column individually.
> >>
> >> Right now I use the following in my css page:
> >>
> >> table {
> >> border-collapse: separate;
> >> border-color:#999999
> >> }
> >> th {
> >> background-color:#000000;
> >> color:white;
> >> text-decoration: none;
> >> border-style:none;
> >> vertical-align:bottom;
> >> font-size:14px;
> >> }
> >> td {
> >> empty-cells: show;
> >> text-align:left;
> >> }
> >>
> >> But this sets all the tables in the application the same.
> >>
> >> What I am trying to do is something like:
> >>
> >> standard.table
> >> standard.td
> >> standard.th
> >> customer.table
> >> customer.td
> >> customer.th
> >> client.table
> >> client.td
> >> client.th
> >>
> >> Is there a way to do something like this and just assign one of the 3 to
> >> a
> >> particular table using css?
> >>
> >> Thanks,
> >>
> >> Tom

> >


 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      07-20-2006
I am referring to your example.

You have:

MyGrid th...
or
MyGrid th, MyOtherGrid th

There are no "."s there.

Where would I set this in HTML, since as you said the statement would
typically be:

<th class="SomeClass" id="anID">

where SomeClass would be ".SomeClass" in the css file.

How would I use MyGrid in my HTML?

I am would like to make all the <td><th><tr> different for different grids
(MyGrid, MyOtherGrid).

Thanks,

Tom

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> not entirely sure what you mean...
>
> a css class when declared in css, needs a "." at the beginning, but not
> in the html tag itself
>
> <style>
>
> th {some style}
>
> .SomeClass {some style}
>
> #anID {some style}
>
> </style>
>
> you can refer to the id of an element using #
> you can refer to the class of an element using .
> you can refer to an element using its tag
>
> in html would be like this:
>
> <th class="SomeClass" id="anID">
>
>
> tshad wrote:
>> Would each of the tags have to have a "." on them?
>>
>> For example:
>>
>> .MyGrid table {border-color:#2f2f2f}
>> .MyGrid th { font-family:tahoma }
>> .MyGrid td {text-align:left}
>>
>> Then do something like:
>>
>> <aspataGrid CssClass="MyGrid" ...
>>
>> Thanks,
>>
>> Tom
>>
>> <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) ups.com...
>> > you can combine css tags like this:
>> >
>> > ClassName element { style }
>> >
>> > so if your grid has a CssClassName of MyGrid:
>> >
>> > MyGrid th { font-family:tahoma }
>> >
>> > or even
>> >
>> > MyGrid th, MyOtherGrid th { some style }
>> >
>> >
>> > tshad wrote:
>> >> I am trying to set up various grids with different displays and don't
>> >> want
>> >> to set each row and column individually.
>> >>
>> >> Right now I use the following in my css page:
>> >>
>> >> table {
>> >> border-collapse: separate;
>> >> border-color:#999999
>> >> }
>> >> th {
>> >> background-color:#000000;
>> >> color:white;
>> >> text-decoration: none;
>> >> border-style:none;
>> >> vertical-align:bottom;
>> >> font-size:14px;
>> >> }
>> >> td {
>> >> empty-cells: show;
>> >> text-align:left;
>> >> }
>> >>
>> >> But this sets all the tables in the application the same.
>> >>
>> >> What I am trying to do is something like:
>> >>
>> >> standard.table
>> >> standard.td
>> >> standard.th
>> >> customer.table
>> >> customer.td
>> >> customer.th
>> >> client.table
>> >> client.td
>> >> client.th
>> >>
>> >> Is there a way to do something like this and just assign one of the 3
>> >> to
>> >> a
>> >> particular table using css?
>> >>
>> >> Thanks,
>> >>
>> >> Tom
>> >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP + JS + CSS: why ajax doesn't display using CSS on main doc? SeanInSeattle Javascript 5 12-13-2007 12:50 PM
CSS Layout question - how to duplicate a table layout with CSS Eric ASP .Net 4 12-24-2004 04:54 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM
print.css and screen.css tom watson HTML 1 09-09-2003 02:48 PM



Advertisments