SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changing colour of td

    Hi guys

    How can I change the colour of just 1 cell. I have called the class .today
    but it isnt changing the background of the actual td cell

    thanks in advance


    CSS
    PHP Code:
    table.cal{
        
    width:790px;
        
    table-layout:fixed;
    }
    .
    cal th{
        
    text-align:center;
        
    font-size:12px;
        
    padding:0 0 1px;
        
    color:red;
        
    vertical-align:top;
    }

    .
    today {
        
    background-color:red;
        
    width:1112px;
        
    height:120px;
        
    border-right:1px solid #fff;
        
    border-bottom:1px solid #fff;
        
    vertical-align:top;



    line 15

    PHP Code:
    <table border="0"  align="center" class="cal">

    <
    tr>
    {foreach 
    from=$days item=i}
       <
    th scope="col">
    {
    $i}
       </
    th>
    {/foreach}
    </
    tr>

    {foreach 
    from=$cal item=i}
    <
    tr>
       {foreach 
    from=$i item=o}
       {if  (
    $currentdaydate == $o.num &&  $currentmonthdate == $months[$month] &&  $currentyeardate == "$year")}
          <
    td  width="140" height="80" valign="middle" align="center"  class="today">
          
           {elseif 
    $o.num == null}
             <
    td  width="80" height="80" valign="middle" align="center" class="empty" >   
          
          {else}
          
             <
    td  width="80" height="80" valign="middle" align="center" >   
          
          
          
          
          
          
          {/if}
          {if 
    $o.num == null}
             <
    h5>&nbsp;</h5>
          {else}
             <
    h5>{$o.num}</h5>

    {if  (
    $currentdaydate == $o.num &&  $currentmonthdate == $months[$month] &&  $currentyeardate == "$year")}
    <
    center><b><br />Today</b></center>
    {/if}
    {foreach 
    from=$thedaydata item=bd}

    {if  (
    $bd.Start|date_format:"%e" == $o.num &&  $bd.Start|date_format:"%B" == $months[$month] &&  $bd.Start|date_format:"%Y" == "$year")
     

    }






    <
    center><br /><b><a href=event.php?id={$bd.Dates_ID}>{$bd.Event_Name}</b><br /><Br /></a></center>

    {/if}














    {if 
    $bd==''}
    <
    br /><center><A href=setupmenu.php>Setup this day</a></center>
    {/if}

    {/foreach}



          {/if}
          </
    td>
       {/foreach}
    </
    tr>
    {/foreach}

    </
    table

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Hi, it might just be overridden by something. Look in firebug and see what is overridding it.

    Give us a link to the site for a correct diagnosis .
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  3. #3
    Design Your Site Team bronze trophy Erik J's Avatar
    Join Date
    May 2007
    Location
    Countryside, Sweden
    Posts
    3,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try more specificity to debug/solve the probable overriding.
    Code:
    table.cal td.today {
        background-color:red;
        width:1112px;
        height:120px;
        border-right:1px solid #fff;
        border-bottom:1px solid #fff;
        vertical-align:top;
    }
    Happy ADD/ADHD with Asperger's


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •