473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Using CSS with Grids/Tables

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
Jul 7 '06 #1
4 1354
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
Jul 7 '06 #2
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:

<asp:DataGrid CssClass="MyGrid" ...

Thanks,

Tom

<ne**********@gmail.comwrote in message
news:11*********************@s16g2000cws.googlegro 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

Jul 11 '06 #3
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:

<asp:DataGrid CssClass="MyGrid" ...

Thanks,

Tom

<ne**********@gmail.comwrote in message
news:11*********************@s16g2000cws.googlegro 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
Jul 11 '06 #4
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><trdifferent for different grids
(MyGrid, MyOtherGrid).

Thanks,

Tom

<ne**********@gmail.comwrote in message
news:11**********************@75g2000cwc.googlegro 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:

<asp:DataGrid CssClass="MyGrid" ...

Thanks,

Tom

<ne**********@gmail.comwrote in message
news:11*********************@s16g2000cws.googlegr oups.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

Jul 20 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Paul Clark | last post by:
Hi, I am converting a VB6 mobile project (Pocket PC) onto a CE.Net machine and am struggling with the new way of handling datagrids. I have my database and tables setup and stuffed with data...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
0
by: Gareth Stretch | last post by:
Hi Guys. i am using C#.net connecting to an Access database using OleDbConnection i am using the following select Statement to join 3 tables string strdvds = "SELECT dvd.name,...
0
by: IGotYourDotNet | last post by:
I have a page and I need to put multiple grids on it, (10 to be exact). The issue i'm having is sometime some grids have 3 records and sometimes they can have 20 records and what happens is that the...
1
by: kingster | last post by:
Hi, I have a regular dataset and all i want to do is make a pivot table display in a browser with the datasource of the pivot table to be this dataset and then the end-user will be able to do...
0
by: David Veeneman | last post by:
This post is for the Google crawler-- no response in required. Can a containment hierarchy made up of two collections derived from BindingList<T> be data-bound to master-detail dataGridView...
0
by: Jordi | last post by:
I'm making a feature-file to train a Neural Network, but now that I've added a new feature, the output becomes corrupted. The output is as follows: 3000 25 1_002858 5 0 0 0 0 2 2 0 0 0 0 2 2 0 0...
8
by: Rick | last post by:
VS 2005 I' m setting up a parent/child datagridviews in a form. I am doing a lot of this by hand coding in order to get the feel of things. I want a change in the parent table to trigger a...
17
by: R.Rafii | last post by:
Hi, I have a simple (?) question for you all experts. I have a button that performs a query on my SQL and fill a datagrid on the form The code: Dim sconn As New SqlConnection()...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.