Welcome Guest, Not a member yet? Register   Sign In
Table specific column width
#7

[eluser]cideveloper[/eluser]
add a class definition to your table using

Code:
$tmpl = array ( 'table_open'  => '<table class="templ_table">' );

$this->table->set_template($tmpl);

and then your table will look like this

Code:
<table class="templ_table">
<caption>Colors</caption>
<tr>
<th>Name</th><th>Color</th><th>Size</th></tr>
<tr>
<td>Fred</td><td>Blue</td><td>Small</td></tr>
<tr>
<td>Mary</td><td>Red</td><td>Large</td></tr>
<tr>
<td>John</td><td>Green</td><td>Medium</td></tr>
</table>

and then you can use the css nth-child selectors to set widths

Code:
.templ_table tr>:nth-child(1){
    width: 50px;
}

.templ_table tr>:nth-child(2){
    width: 250px;
}

.templ_table tr>:nth-child(3){
    width: 100px;
}

Edit: Crap, this might not work in IE. I cant test this right now.


Messages In This Thread
Table specific column width - by El Forum - 01-13-2011, 10:46 AM
Table specific column width - by El Forum - 01-13-2011, 01:04 PM
Table specific column width - by El Forum - 01-13-2011, 01:47 PM
Table specific column width - by El Forum - 01-13-2011, 01:50 PM
Table specific column width - by El Forum - 01-13-2011, 02:19 PM
Table specific column width - by El Forum - 01-13-2011, 02:45 PM
Table specific column width - by El Forum - 01-13-2011, 02:46 PM
Table specific column width - by El Forum - 01-13-2011, 02:52 PM
Table specific column width - by El Forum - 01-13-2011, 05:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB