# tablepress/2.2.2/blocks/table/src/save.js

TablePress – Tables in WordPress made easy, version 2.2.2. 37 lines.

- Page: https://pluginprobe.com/plugins/tablepress/2.2.2/code/blocks/table/src/save.js
- Raw: https://pluginprobe.com/plugins/tablepress/2.2.2/raw/blocks/table/src/save.js
- Modified: 2023-11-02T08:57:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tablepress/2.2.2/code/blocks/table/src/save.js#L10-L20`.

```javascript
/**
 * JavaScript code for the TablePress table block in the block editor.
 *
 * @package TablePress
 * @subpackage Blocks
 * @author Tobias Bäthge
 * @since 2.0.0
 */

/**
 * WordPress dependencies
 */
import { RawHTML } from '@wordpress/element';

/**
 * The save function defines the way in which the different attributes should
 * be combined into the final markup, which is then serialized by the block
 * editor into `post_content`.
 *
 * @param {Object} params                       Function parameters.
 * @param {Object} params.attributes            Block attributes.
 * @param {string} params.attributes.id         Table ID.
 * @param {string} params.attributes.parameters Table render attributes.
 * @return {Element} Element to render.
 */
export default function save( { attributes: { id = '', parameters = '' } } ) {
	if ( '' === id ) {
		return '';
	}

	parameters = parameters.trim();
	if ( '' !== parameters ) {
		parameters += ' ';
	}
	return <RawHTML>{ `[${ tp.table.shortcode } id=${ id } ${ parameters }/]` }</RawHTML>;
}

```
