Jump to content

jhoover

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by jhoover

  1. So does that mean that something is overriding it?
  2. This is the .css I'm including. body { font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; color: #4f6b72; background: #BCD2EE; } a { color: #c75f3e; } #mytable { width: 780px; padding: 0; margin-left: auto; margin-right: auto; } caption { padding: 0 0 5px 0; width: 700px; font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; text-align: right; } th { font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; color: #4f6b72; border-right: 1px solid #C1DAD7; border-bottom: 1px solid #C1DAD7; border-top: 1px solid #C1DAD7; letter-spacing: 2px; text-transform: uppercase; text-align: left; padding: 6px 6px 6px 12px; background: #CAE8EA url(bg_header.jpg) no-repeat; } th.nobg { border-top: 0; border-left: 0; border-right: 1px solid #C1DAD7; background: none; } td { border-right: 1px solid #C1DAD7; border-bottom: 1px solid #C1DAD7; background: #fff; padding: 6px 6px 6px 12px; color: #4f6b72; font: normal 13px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; } row1 { background: #F5FAFA; color: #797268; } row2 { background: #fff; color: #4f6b72; } td.alt { background: #F5FAFA; color: #797268; } th.spec { border-left: 1px solid #C1DAD7; border-top: 0; background: #fff url(images/bullet1.gif) no-repeat; font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; } th.specalt { border-left: 1px solid #C1DAD7; border-top: 0; background: #f5fafa url(images/bullet2.gif) no-repeat; font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; color: #797268; }
  3. They are alternating per the code but the rows are staying all white. Is it the td's of every other row that I want to change? I'm a little confused. I attached a screenshot of what is showing up and a bit of the code below. <tr style="background-color:black;"> <td width="28%"><span class="style1">July 21, 2011 - 1:40pm</span></td> <td width="7%">45</td> <td width="17%">ergerg</td> <td width="28%">ergerg</td> <td width="15%"><div align="center"><a href="https://www.midmich.edu/admissions/admin/print/index.php?id=45" target='_blank'>View & Print</a></div></td> <td width="5%"><div align="center"> <input type="checkbox" name="checkbox[]" value="45" /> <label for="checkbox"></label> </div></td> </tr> <tr style="background-color:white;"> <td width="28%"><span class="style1">July 21, 2011 - 1:43pm</span></td> <td width="7%">46</td> <td width="17%">sdcsdc</td> <td width="28%">sdvsdv</td> <td width="15%"><div align="center"><a href="https://www.midmich.edu/admissions/admin/print/index.php?id=46" target='_blank'>View & Print</a></div></td> <td width="5%"><div align="center"> <input type="checkbox" name="checkbox[]" value="46" /> <label for="checkbox"></label> </div></td> </tr> <tr style="background-color:black;"> <td width="28%"><span class="style1">July 21, 2011 - 1:43pm</span></td> <td width="7%">47</td> <td width="17%">sdcsdc</td> <td width="28%">sdvsdv</td> <td width="15%"><div align="center"><a href="https://www.midmich.edu/admissions/admin/print/index.php?id=47" target='_blank'>View & Print</a></div></td> <td width="5%"><div align="center"> <input type="checkbox" name="checkbox[]" value="47" /> <label for="checkbox"></label> </div></td> </tr> <tr style="background-color:white;"> <td width="28%"><span class="style1">July 21, 2011 - 1:53pm</span></td> <td width="7%">48</td> <td width="17%">fake</td> <td width="28%">name</td> <td width="15%"><div align="center"><a href="https://www.midmich.edu/admissions/admin/print/index.php?id=48" target='_blank'>View & Print</a></div></td> <td width="5%"><div align="center"> <input type="checkbox" name="checkbox[]" value="48" /> <label for="checkbox"></label> </div></td> </tr> [attachment deleted by admin]
  4. Thanks for the responses. I guess where I'm failing at all this is I'm not sure exactly in my code where I'm supposed to place the <tr style="background-color:<?php echo ($row_update['id']%2) ? 'black' : 'white'; ?>;"> It doesnt work when I put it on one of the existing tr spot and the others are td's and end up coloring the columns.
  5. I've checked it seems a million tutorials that have all been simplat, but i have been unable to get alternating row colors working when pulling info from a mysql database and displaying in a table. Any suggestions? <html> <head> <LINK href="style.css" rel="stylesheet" type="text/css"> <script language="JavaScript"> function checkAll(){ for (var i=0;i<document.forms[0].elements.length;i++) { var e=document.forms[0].elements[i]; if ((e.name != 'allbox') && (e.type=='checkbox')) { e.checked=document.forms[0].allbox.checked; } } } </script> </head> <body> <form id="form1" name="form1" method="post" action="handler.php"> <div align="center"><h1>Unprocessed Applications</h1><input type="submit" name="button" id="button" value="Submit" /></div> <table id="mytable" cellspacing="0"> <tr> <th scope="col"><strong>Date</strong></th> <th scope="col"><strong>ID</strong></th> <th scope="col"><span class="style1 style3"><strong>First Name</strong></span></th> <th scope="col"><span class="style1 style3"><strong>Last Name</strong></span></th> <th scope="col"><div align="center"><span class="style3"></span></div>Check All -></th> <th scope="col"><div align="center"><input type="checkbox" value="on" name="allbox" onclick="checkAll();"/><br /></div></th> </tr> <?php do { ?> <tr> <td width="28%"><span class="style1"><?php echo date('F j, Y - g:ia', $row_update['timestamp']); ?></span></td> <td width="7%"><?php echo $row_update['id']; ?></td> <td width="17%"><?php echo $row_update['first_name']; ?></td> <td width="28%"><?php echo $row_update['last_name']; ?></td> <td width="15%"><div align="center"><?php echo "<a href=\"https://www.*******/index.php?id=". $row_update['id']."\" target='_blank'>View & Print</a>"; ?></div></td> <td width="5%"><div align="center"> <input type="checkbox" name="checkbox[]" value="<?php echo $row_update['id'] ?>" /> <label for="checkbox"></label> </div></td> </tr> <?php } while ($row_update = mysql_fetch_assoc($update)); ?> </table> <label for="button"></label> <div align="center"><input type="submit" name="button" id="button" value="Submit" /></div> </form> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.