How to add <tr> attribute id $this->table->add_row(); |
[eluser]dimasVS[/eluser]
Hi all, I need your help, how to add attribute(s) in table row <tr> ? for example I want to create table like the example below : <table> <tr id="test"><td>Testing</td></tr> </table> how to create id="test" in $this->table->add_row() ? Thank you very much... Best Regards, Dimas
[eluser]Stockhausen[/eluser]
Hi, i think it's impossible ! Read this information in the user guide http://ellislab.com/codeigniter/user-gui...table.html and look Changing the Look of Your Table zone So generally id for CSS may be jus one time in a page. Préfer to use class for CSS.
[eluser]dimasVS[/eluser]
[quote author="Stockhausen" date="1275387110"]Hi, i think it's impossible ! Read this information in the user guide http://ellislab.com/codeigniter/user-gui...table.html and look Changing the Look of Your Table zone So generally id for CSS may be jus one time in a page. Préfer to use class for CSS.[/quote] Therefore I try to ask question in here, maybe any suggest to solve it. I've been try to read the user guide and don't have any idea. Do I create <tr> manually ?
[eluser]Stockhausen[/eluser]
Please read this zone and put your <tr id="what_you_want"> Changing the Look of Your Table The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template prototype: Code: $tmpl = array ( Quote:Note: You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each iteration of the row data. You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. In this example, only the table opening tag is being changed: Code: $tmpl = array ( 'table_open' => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
[eluser]dimasVS[/eluser]
[quote author="Stockhausen" date="1275391289"]Please read this zone and put your <tr id="what_you_want"> Changing the Look of Your Table The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template prototype: Code: $tmpl = array ( Quote:Note: You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each iteration of the row data. You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. In this example, only the table opening tag is being changed: Code: $tmpl = array ( 'table_open' => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' ); hmm, I think it just work on first row. How to create it in every row ? and the id/class dinamically change. on the code below, I want to create id/class in ever row that printed in foreach. example : $tmpl = array ( 'row_start' => "<tr id=\"$row->transaksi_jurnal_kasbank_id\">" ); it doesn't work, only printed on first row Code: <?php
[eluser]dimasVS[/eluser]
[quote author="Stockhausen" date="1275393645"]row_alt_start maybe ?[/quote] it also doesn't work..
[eluser]bhogg[/eluser]
You could just build the table in a view using standard PHP/HTML and avoid this mess PHP itself makes for a nice templating language, for example: Code: <?php if ($something === true): ?> I found using the CI table functions hard for others to read/maintain/debug and with issues such as this one.
[eluser]bhogg[/eluser]
Also, in your code, it looks like one of the problems is: Code: <a >transaksi_jurnal_kasbank_id\" onclick=\"return editx()\"> Should that > not be \"? Maybe either try standard HTML in a view, or format so the lines aren't so long and it's a bit easier to see/debug (ie. one line per element when building the table row)
[eluser]dimasVS[/eluser]
[quote author="bhogg" date="1275396408"]You could just build the table in a view using standard PHP/HTML and avoid this mess PHP itself makes for a nice templating language, for example: Code: <?php if ($something === true): ?> I found using the CI table functions hard for others to read/maintain/debug and with issues such as this one.[/quote] It just the last choice, |
Welcome Guest, Not a member yet? Register Sign In |