Welcome Guest, Not a member yet? Register   Sign In
need help with table class
#6

[eluser]jedd[/eluser]
Well, as I say, a lot of people move away from the CI Table Class. I used to use it, but found, like you, some limitations .. and after a few questions on the forums realised that a) I wasn't alone, and b) it's okay to just ignore bits of CI if they don't suit your particular requirement.

I think you might be over-estimating the work required to generate your own partial view that'll generate your table. Sure, you seem to be trying to pick up a bunch of techs at the same time, but tables aren't that tricky, and your data set seems relatively small here anyway. It's just a TABLE, and then lots of TR/TD pairings encased in a loop, with either a conditional or, as Jondolar suggested, just calling in the class based on a piece of the data you are already working with. As you have observed, the CI Table class doesn't lend itself to this (it's do-able, but not straightforward, from memory).

Aside: some people suggest, and I can see their point, that you are better off learning 'raw' PHP before learning a framework. Each of us can only ever experience one of those two permutations, but my gut feel is that it probably would be easier - if for no other reason than providing a clearer idea of where PHP stops and CI picks up. /Aside

Quote:As far as the CSS Class, I sort of understand it and what its intent is(after looking it up today). So if i have td.net and td.net and td.exch, I can have different colors assigned to my html <td> based on the class. I currently have my table working, but the person that is going to use this application, has asked to make each 'SYSTEM' a different color. Although i'm not sure he will like it once he sees it.

Correct. CSS is generally case insensitive, but nonetheless in this case I'd stick with the exact string that you're getting out of your DB - so if it's net/exch/rg - then go for that, but if it's upper case, then use upper-case in your CSS. Be aware that you can't use upper and lower case of a string and expect it'll differentiate, though (net = NET as far as CSS classes are concerned). And yes, there's scope for some garish colour activity going on there - do you have just the three you've cited so far, or are there more?

If you provide a bit more information - rough layout of the table, the bits of data you're extracting - we can doubtless point you in the right (or at least a) direction.

Btw, do you have your CSS loading properly in your main or primary view file? Are you okay with the idea of generating view partials and feeding them back into a main view?


Messages In This Thread
need help with table class - by El Forum - 08-07-2009, 10:37 AM
need help with table class - by El Forum - 08-07-2009, 01:59 PM
need help with table class - by El Forum - 08-10-2009, 08:14 AM
need help with table class - by El Forum - 08-10-2009, 09:18 AM
need help with table class - by El Forum - 08-10-2009, 12:03 PM
need help with table class - by El Forum - 08-10-2009, 12:27 PM
need help with table class - by El Forum - 08-10-2009, 12:41 PM
need help with table class - by El Forum - 08-10-2009, 04:36 PM
need help with table class - by El Forum - 08-11-2009, 12:28 PM
need help with table class - by El Forum - 08-13-2009, 06:22 AM
need help with table class - by El Forum - 08-13-2009, 06:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB