Using CSS with Grids/Tables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    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


  • neilmcguigan@gmail.com

    #2
    Re: Using CSS with Grids/Tables

    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

    Comment

    • tshad

      #3
      Re: Using CSS with Grids/Tables

      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="MyGri d" ...

      Thanks,

      Tom

      <neilmcguigan@g mail.comwrote in message
      news:1152293380 .239366.79370@s 16g2000cws.goog legroups.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.tab le
      >standard.td
      >standard.th
      >customer.tab le
      >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
      >

      Comment

      • neilmcguigan@gmail.com

        #4
        Re: Using CSS with Grids/Tables

        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="SomeClas s" 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="MyGri d" ...
        >
        Thanks,
        >
        Tom
        >
        <neilmcguigan@g mail.comwrote in message
        news:1152293380 .239366.79370@s 16g2000cws.goog legroups.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

        Comment

        • tshad

          #5
          Re: Using CSS with Grids/Tables

          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="SomeClas s" 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><trdiff erent for different grids
          (MyGrid, MyOtherGrid).

          Thanks,

          Tom

          <neilmcguigan@g mail.comwrote in message
          news:1152648191 .105079.320550@ 75g2000cwc.goog legroups.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="SomeClas s" 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:DataGri d CssClass="MyGri d" ...
          >>
          >Thanks,
          >>
          >Tom
          >>
          ><neilmcguigan@ gmail.comwrote in message
          >news:115229338 0.239366.79370@ s16g2000cws.goo glegroups.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.tab le
          >standard.td
          >standard.th
          >customer.tab le
          >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
          >
          >

          Comment

          Working...