Welcome Guest, Not a member yet? Register   Sign In
Formatting Tables with CSS
#5

[eluser]pickupman[/eluser]
There is nothing wrong with that. No need to use the table library if don't want to. Just change it up a bit with
Code:
<?php $this->load->helper('string');?>

<table width=“57%” border=“1” cellspacing=“0” cellpadding=“0” align=“center”>
      <tr>
      <th>Employee ID</th>
      <th>Employee First Name</th>
      <th>Employee Last Name</th>
      <th>Department</th>
      </tr>
      &lt;?php
      foreach($result as $row): ?&gt;
      <tr class="&lt;?php echo alternator('alt,'');?&gt;">
      <td>&lt;?=$row->empid?&gt;</td>
      <td >&lt;?=$row->empfirstname?&gt;</td>
      <td >&lt;?=$row->emplastname?&gt;</td>
      <td >&lt;?=$row->deptid?&gt;</td>
      </tr>
      &lt;?php endforeach; ?&gt;
    </table>

Or if you are using jQuery you can cheat, and keep your existing markup.
Code:
//In script block
$("table tr:odd").addClass('alt');


Messages In This Thread
Formatting Tables with CSS - by El Forum - 04-15-2010, 07:23 PM
Formatting Tables with CSS - by El Forum - 04-15-2010, 07:36 PM
Formatting Tables with CSS - by El Forum - 04-15-2010, 07:37 PM
Formatting Tables with CSS - by El Forum - 04-15-2010, 08:38 PM
Formatting Tables with CSS - by El Forum - 04-15-2010, 10:06 PM
Formatting Tables with CSS - by El Forum - 04-15-2010, 10:48 PM
Formatting Tables with CSS - by El Forum - 04-15-2010, 11:05 PM
Formatting Tables with CSS - by El Forum - 04-15-2010, 11:43 PM
Formatting Tables with CSS - by El Forum - 04-16-2010, 12:17 AM
Formatting Tables with CSS - by El Forum - 04-16-2010, 05:54 AM
Formatting Tables with CSS - by El Forum - 04-16-2010, 06:39 AM
Formatting Tables with CSS - by El Forum - 04-16-2010, 08:18 AM
Formatting Tables with CSS - by El Forum - 04-16-2010, 06:53 PM
Formatting Tables with CSS - by El Forum - 04-17-2010, 01:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB