Split a Table Cell Introduction
Aspose.Slides.Cloud API provides different options for splitting table cells. There are four of them: by width, by height, by col span and by row span. Last two options can be applied for merged cells. The methods accept a mandatory value argument. In the case of splitting by width or height, you have to specify desired cell width or height accordingly. In the case of splitting by span, the col span or row span value has to be provided.
SplitTableCell
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/rows/{rowIndex}/cells/{cellIndex}/splitByWidth/{value}
POST
Returns table info
SplitTableCell
/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/rows/{rowIndex}/cells/{cellIndex}/splitByHeight/{value}
POST
Returns table info
SplitTableCell
/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/rows/{rowIndex}/cells/{cellIndex}/splitByColSpan/{value}
POST
Returns table info
SplitTableCell
/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/rows/{rowIndex}/cells/{cellIndex}/splitByRowSpan/{value}
POST
Returns table info
SplitTableCell
Examples
cURL Example
The code example below shows how to split a cell by width. The width of the new cell is 10.
SDK Examples
C#
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
int slideIndex = 9 ;
int shapeIndex = 1 ;
int rowIndex = 1 ;
int cellIndex = 1 ;
int cellWidth = 10 ;
Table response = api . SplitTableCell ( "MyPresentation.pptx" , slideIndex , shapeIndex , rowIndex , cellIndex , TableCellSplitType . SplitByWidth , cellWidth );
Console . WriteLine ( "Cells count in the row: " + response . Rows [ 0 ]. Cells . Count );
Java
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
int slideIndex = 9 ;
int shapeIndex = 1 ;
int rowIndex = 1 ;
int cellIndex = 1 ;
double cellWidth = 10 . 0 ;
Table response = api . splitTableCell ( "MyPresentation.pptx" , slideIndex , shapeIndex , rowIndex , cellIndex , TableCellSplitType . SPLITBYWIDTH , cellWidth , null , null , null );
System . out . println ( "Cells count in the row: " + response . getRows (). get ( 0 ). getCells (). size ());
PHP
use Aspose\Slides\Cloud\Sdk\Api\Configuration ;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi ;
$config = new Configuration ();
$config -> setAppSid ( "MyClientId" );
$config -> setAppKey ( "MyClientSecret" );
$api = new SlidesApi ( null , $config );
$slideIndex = 9 ;
$shapeIndex = 1 ;
$rowIndex = 1 ;
$cellIndex = 1 ;
$cellWidth = 10 ;
$result = $api -> splitTableCell ( "MyPresentation.pptx" , $slideIndex , $shapeIndex , $rowIndex , $cellIndex , 'SplitByWidth' , $cellWidth );
print ( "Cells count in the row: " . count ( $result -> getRows ()[ 0 ] -> getCells ()));
Ruby
configuration = AsposeSlidesCloud :: Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
api = AsposeSlidesCloud :: SlidesApi . new ( configuration )
slide_index = 9
shape_index = 1
row_index = 1
cell_index = 1
cell_width = 10
result = api . split_table_cell ( "MyPresentation.pptx" , slide_index , shape_index , row_index , cell_index , "SplitByWidth" , cell_width )
puts "Cells count in the row: #{ result . rows [ 0 ]. cells . length } "
Python
import asposeslidescloud
from asposeslidescloud.configuration import Configuration
from asposeslidescloud.apis.slides_api import SlidesApi
configuration = Configuration ()
configuration . app_sid = 'MyClientId'
configuration . app_key = 'MyClientSecret'
api = SlidesApi ( configuration )
slide_index = 9
shape_index = 1
row_index = 1
slides_index = 1
cell_index = 1
cell_width = 10
response = api . split_table_cell ( "MyPresentation.pptx" , slide_index , shape_index , row_index , cell_index , 'splitByWidth' , cell_width )
print ( f "Cells count in the row: { len(response.rows[0].cells) }" )
Node.js
const CloudSdk = require ( "asposeslidescloud" );
const api = new CloudSdk . SlidesApi ( "MyClientId" , "MyClientSecret" );
let slideIndex = 9 ;
let shapeIndex = 1 ;
let rowIndex = 1 ;
let cellIndex = 1 ;
let cellWidth = 10 ;
const result = await api . splitTableCell ( "MyPresentation.pptx" , slideIndex , shapeIndex , rowIndex , cellIndex , CloudSdk . TableCellSplitType . SplitByWidth , cellWidth );
console . log ( "Cells count in the row: " + result . body . rows [ 0 ]. cells . length );
Go
cfg := asposeslidescloud . NewConfiguration ()
cfg . AppSid = "MyClientId"
cfg . AppKey = "MyClientSecret"
api := asposeslidescloud . NewAPIClient ( cfg )
fileName := "MyPresentation.pptx"
var slideIndex int32 = 9
var shapeIndex int32 = 1
var rowIndex int32 = 1
var cellIndex int32 = 1
var cellWidth int32 = 10
result , _ , e := api . SlidesApi . SplitTableCell ( fileName , slideIndex , shapeIndex , rowIndex , cellIndex , "SplitByWidth" , float64 ( cellWidth ), "" , "" , "" )
if e != nil {
fmt . Printf ( "Error: %v." , e )
return
}
fmt . Printf ( "Cells count in the row: %v" , len ( result . GetRows ()[ 0 ]. GetCells ()))
C++
Perl
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my %params = (
'name' => "MyPresentation.pptx" ,
'split_type' => 'SplitByWidth' ,
'value' => 10 ,
'slide_index' => 9 ,
'shape_index' => 1 ,
'row_index' => 1 ,
'cell_index' => 1 );
my $response = $api -> split_table_cell ( %params );
print "Cells count in the row: scalar @{$response->{rows}[0]{cells}} \n" ;
Swift
SDK Source
The Aspose for Cloud SDKs can be downloaded from the following page: Available SDKs