html table improvement |
[eluser]rafael apocalypse[/eluser]
Hello Everybody, I'm trying to improve the html table library, so it could accept a variable witch will be used to adjust the width of the cel. Is anybody knows a easy way to do this with the need to rewrite all the table library? regards, RA
[eluser]eoinmcg[/eluser]
Hi, You can set a table template, which allows you complete control over all aspects of your table. http://ellislab.com/codeigniter/user-gui...table.html Check the above page in the user guide, about half way down
[eluser]rafael apocalypse[/eluser]
I'm looking for something with more control, for example I need to ajust a variable witdh for each column in the table, and just use another template doesn't allow me to do this. I'm thinking in use something like this: http://ellislab.com/forums/viewthread/102564/ but using real table to show tabled data
[eluser]Unknown[/eluser]
I'm looking for the same thing, any other suggestions?
[eluser]eoinmcg[/eluser]
Aha, rafael apocalypse! I guess I didn't quite digest the bit about column width *ahem!* :cheese: You wouldn't need to rewrite the entire table library and, as the commments in that thread you posted argue, there are a few problems with that approach. I had a quick look at the table library, which is a very well thought out piece of code, and came up with the following extension to the library. It adds a class name (<th class="cell_0"> etc) to each of the th tags, allowing you to do your magic in the css: Code: <?php Basically, I just added a comment and a small change on lines 67 & 68. Hope this helps.
[eluser]garymardell[/eluser]
I never understood why people don't just stick to having the html written rather than generated. Doesn't leave much flexibility having it generated.
[eluser]eoinmcg[/eluser]
@garymardell, of course it's a question of personal preference but on a project that requires more than a couple of tables I wouldn't fancy writing and maintaining the html for all of them
[eluser]sophistry[/eluser]
i'm surprised this never made it into the core... it's pretty good if i do say so myself. new generate method to pass arrays to table to define th and tds individually
[eluser]rafael apocalypse[/eluser]
So do I! now I really don't know what to do, stop to write my own code, and start to use this, or keep going with my library… Changing the subject, is there a place where we can ask for some code to be in the core, or some way to contribute with ci development? regards, |
Welcome Guest, Not a member yet? Register Sign In |