why i get th cell name “Array” ?
How set table th width?
$th = array( array(array(null),
array('width'=>'80')) );
echo $this->Html->tableHeaders($th);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesn’t look like you’re using the method correctly.
The proper usage for tableHeaders() is tableHeaders($tableHeaders, $trOptions, $thOptions);
The $trOptions and $thOptions should be arrays where you set the options for the HTML elements.
So to set the th width as you’re trying to do above you’d have to do something like this:
The th options array has to be the third argument so you have to include $trOptions as the second even if it’s just an empty array.
All this info is actually explained quite well in the CakePHP documentation and API, so I’d encourage you to check there as well if you haven’t already.
Here’s info on $Html->tableHeaders in the documentation:
http://book.cakephp.org/view/1446/tableHeaders
Here’s the entry for $Html->tableHeaders in the CakePHP API:
http://api.cakephp.org/class/html-helper#method-HtmlHelpertableHeaders