Welcome Guest, Not a member yet? Register   Sign In
Right justify numeric fields in table display
#2

[eluser]Michael Wales[/eluser]
I wouldn't use the table helper honestly - I would just loop through each of the returned results, something like this:

Code:
<table>
&lt;?php foreach ($result as $row) { ?&gt;
  <tr><td>&lt;?= $row->column_1; ?&gt;</td>
      <td>&lt;?= $row->column_2; ?&gt;</td>
      <td>&lt;?= $row->column_3; ?&gt;</td></tr>
&lt;?php } ?&gt;
</table>

You could then easily apply an id or class to any of the columns and style them with CSS.

Or - if you want to be really ghetto with it, you could use CSS selectors (which may not be supported in all browsers) and setup an adjacent sibling selector:

Code:
tr > td + td + td {text-align:right;}

That would target and td, that follows a td, that follows a td, that is a child of a tr.


Messages In This Thread
Right justify numeric fields in table display - by El Forum - 08-08-2007, 10:20 AM
Right justify numeric fields in table display - by El Forum - 08-08-2007, 10:59 AM
Right justify numeric fields in table display - by El Forum - 08-08-2007, 06:00 PM
Right justify numeric fields in table display - by El Forum - 08-08-2007, 06:14 PM
Right justify numeric fields in table display - by El Forum - 08-08-2007, 06:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB