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

[eluser]jedd[/eluser]
Hi buckboru,

[quote author="buckboru" date="1249931685"]
Please understand, that i'm trying to get up to speed on PHP, CI, CSS, HTML all at once, so if this is really simple to accomplish, please forgive me. [/quote]

It is, and you are.

The neat thing about Jondolar's suggestion was that you could use SYSTEM1 (as an example) to denote your CSS style as well as the, albeit assumed, variable that you were pulling out of your data. Using the approach you're doing is likely to bite you - rg, exch, net - unless those strings come out of your database too. If they do not, then you need some logic in there to select your CSS TD style based upon those strings - this is perhaps double handling - though it depends how many variations you have to contend with.

Two other small suggestions first - always preview, or at least confirm your message after you post, to make sure it reads well. I think you've mucked up a [ /code ] tag, so it looks like you've posted a code segment twice. Secondly, try to put one question mark somewhere in a post that's asking a question - it makes it easier to narrow in on what your problem is! Wink If you don't know exactly what your problem is (not as weird as it sounds - happens to the best of us) then focus on the 'this is what I expected / wanted to happen' and 'this is what actually did happen' approach - this is useful, too.

Oh, a third suggestion - that you probably won't like - but a lot of CI users move away from the Table Class pretty early on, not least because of this kind of problem - it has a few annoying limitations that are messy to work around, it's easy enough (easier perhaps) to just write your own table generation view partials that do exactly what you want, and/or because generating HTML within the Controller, which is what this Class implies, goes against the MVC approach.

So you may be better off - and I reckon it'd be far less confusing for you, actually - to write your own view partial (stick it in a subdirectory under application/views/ - say snippets, partials, common, tables, - whatever floats your boat) that generates this one table for you.

Finally, can I clarify - do you know what the HTML code you're seeking to generate should look like? As in, for example, do you understand what class= attribute will do for you, and where Jondolar was heading with the suggestion made above?


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