multiline cell in table
-
in shortcode.php
i u want to preserve layout of a multiline cell
\r\n becomes<br />
in html//The content $tbody_content = explode('[-%row%-]' , $content); //explode each row while ($row_counter <= $numrow) { if ($odd_row_counter%2) { $table .= '<tr class="table-alternate row' . $row_counter . '"> '; } else { $table .= '<tr class= "table-noalt row' . $row_counter . '">'; } $odd_row_counter++; $col_counter = 1; unset($cell); if (isset($tbody_content[$row_counter-1])) { $cell = explode('[-%cell%-]' , $tbody_content[$row_counter-1]); //explode each cell } while ($col_counter <= $numcol) { if ($col_counter == 1) { $table .= '<td id="n' . $col_counter . '" class="start">'; } else { $table .= '<td id="n' . $col_counter . '" >'; } if (isset($cell[$col_counter-1])) { $var= $cell[$col_counter-1]; $var = str_replace(array("\r\n", "\n", "\r"), "<br/>", $var); $table .= stripslashes($var); } $table .= '</td>'; $col_counter++; $cell_counter++; } $table .= '</tr>'; $row_counter++; }
- The topic ‘multiline cell in table’ is closed to new replies.