WordPress.org

Forums

Websimon Tables
multiline cell in table (1 post)

  1. cvermeir
    Member
    Posted 2 years ago #

    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++;
    		}

    http://wordpress.org/extend/plugins/websimon-tables/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Websimon Tables
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic