# table/utils/table-properties

module

<a id="interfaces">

## Interfaces

<a id="interface-NormalizedDefaultProperties">

### `NormalizedDefaultProperties`

<a id="type-definitions">

## Type Definitions

<a id="typedef-NormalizeTableDefaultPropertiesOptions">

### `NormalizeTableDefaultPropertiesOptions`

<a id="functions">

## Functions

<a id="function-addDefaultUnitToNumericValue">

### `addDefaultUnitToNumericValue( value, defaultUnit ) → string | number | undefined` _(internal)_

Adds a unit to a value if the value is a number or a string representing a number.

**Note**: It does nothing to non-numeric values.

```typescript
getSingleValue( 25, 'px' ); // '25px'
getSingleValue( 25, 'em' ); // '25em'
getSingleValue( '25em', 'px' ); // '25em'
getSingleValue( 'foo', 'px' ); // 'foo'
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/table-properties.ts#L57)

#### Parameters

* `value: string | number | undefined`

* `defaultUnit: string`

  A default unit added to a numeric value.

#### Returns

* `string | number | undefined`

<a id="function-getNormalizedDefaultCellProperties">

### `getNormalizedDefaultCellProperties( config?, options? ) → NormalizedDefaultProperties` _(internal)_

Returns the normalized default cell properties.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/table-properties.ts#L190)

#### Parameters

* `config?: Partial<NormalizedDefaultProperties>`

  The configuration to normalize.

* `options?: NormalizeTableDefaultPropertiesOptions`

  Options used to determine which properties should be added.

#### Returns

* `NormalizedDefaultProperties`

<a id="function-getNormalizedDefaultProperties">

### `getNormalizedDefaultProperties( config?, options ) → NormalizedDefaultProperties` _(internal)_

Returns the normalized configuration.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/table-properties.ts#L129)

#### Parameters

* `config?: Partial<NormalizedDefaultProperties>`

  The configuration to normalize.

* `options: NormalizeTableDefaultPropertiesOptions`

  Options used to determine which properties should be added.

  Defaults to `{}`

#### Returns

* `NormalizedDefaultProperties`

<a id="function-getNormalizedDefaultTableProperties">

### `getNormalizedDefaultTableProperties( config?, options? ) → NormalizedDefaultProperties` _(internal)_

Returns the normalized default table properties.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/table-properties.ts#L169)

#### Parameters

* `config?: Partial<NormalizedDefaultProperties>`

  The configuration to normalize.

* `options?: NormalizeTableDefaultPropertiesOptions`

  Options used to determine which properties should be added.

#### Returns

* `NormalizedDefaultProperties`

<a id="function-getSingleValue">

### `getSingleValue( objectOrString ) → string | undefined` _(internal)_

Returns a string if all four values of box sides are equal.

If a string is passed, it is treated as a single value (pass-through).

```typescript
// Returns 'foo':
getSingleValue( { top: 'foo', right: 'foo', bottom: 'foo', left: 'foo' } );
getSingleValue( 'foo' );

// Returns undefined:
getSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );
getSingleValue( { top: 'foo', right: 'foo' } );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/table-properties.ts#L30)

#### Parameters

* `objectOrString: string | BoxStyleSides | undefined`

#### Returns

* `string | undefined`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
