[SOLVED] How to get colspan when using the table library |
[eluser]123wesweat[/eluser]
Hi, i can't find the use of colspan in http://ellislab.com/codeigniter/user-gui...table.html Any work around??? and still using the library
[eluser]ShiverCube[/eluser]
The Table Library doesn't make any use of colspan. I'm currently looking into extending the library to automatically set the colspan for rows which contains a smaller number of values than there are columns. I'm not sure whether that's the same problem you are facing, but if I find a solution I will post it here.
[eluser]ShiverCube[/eluser]
Well here's my solution to the problem I was having. I'm not sure whether it will help you at all. Basically I just extended the Table Library and modified the generate() method, replacing the existing section for building the table rows with the the following. Code: // Build the table rows What this does is set the colspan so that all rows remain the same length. So if for example the following was used: Code: $this->table->set_heading('Name', 'Color', 'Size'); Then the 2 row will have its colspan set to 3. If that doesn't help you then let me know you problem in more detail so that I can help ![]()
[eluser]123wesweat[/eluser]
tx, i am using your code by creating a MY_Table library and a generateColspan() method. Another question: How do i get a <td class="some-style">??? I am trying to recreate cellspacing="15" which i can't use in the <table ....> tag as i am also using a general reset.css. Anym thoughts??
[eluser]ShiverCube[/eluser]
Well the Table library supports basic templating: Code: $this->table->set_template( But if you need to set a class for each cell individually, then you will have to extend the class again.
[eluser]123wesweat[/eluser]
yeah, shivercube i noticed the table library just supports basic temmplating so i have altered my strategy, here the table tags/classes are in a seperate view file called detail_view Code: //data from db based on id might be helpfull for others
[eluser]Unknown[/eluser]
This might be helpful as well: Code: // Build the table rows This is pretty basic code for making sure the supplied colspan is used. You can modify it by removing the class attribute but that's one of those things I need for my application to look nicer. The code above can be executed with this command from the view: Code: $cell_data = array( |
Welcome Guest, Not a member yet? Register Sign In |