my code is below.it show the output in table format having no problems. But when the particular tr gets long output from database then the table break. Now how can i fixed the tr width strictly?let say i want each td cannot be more than 100px. How can i do it? Note: Here table means html table,not the database table.
if ($query->num_rows() > 0)
{ $output = ''; foreach ($query->result() as $function_info) { if ($description) {
$output .= ''.$function_info->songName.''; $output .= ''.$function_info->albumName.''; $output .= ''.$function_info->artistName.''; $output .= ''.$function_info->Code1.''; $output .= ''.$function_info->Code2.''; $output .= ''.$function_info->Cod开发者_如何学编程e3.''; $output .= ''.$function_info->Code4.''; $output .= ''.$function_info->Code5.''; } else { $output .= ''.$function_info->songName.''; } } $output .= ''; return $output; }else { return '
Result not found.
'; }thanks riad
You can either do it in the HTML...
<td style="width: 100px">
Or you can try using wordwrap.
精彩评论