Skip to content

Commit 2e3fb4d

Browse files
Merge pull request #3759 from syncfusion-content/378279-Max-Row-CM
378279: Added topic about how to set maximum rows, columns in Core and MVC
2 parents 55b35e4 + 33a795f commit 2e3fb4d

File tree

3 files changed

+111
-5
lines changed

3 files changed

+111
-5
lines changed
Loading
Loading

ej2-asp-core-mvc/document-editor/table.md

Lines changed: 111 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: post
3-
title: Table in ##Platform_Name## Document Editor Component
3+
title: Table in ##Platform_Name## Document Editor Component | Syncfusion
44
description: Learn here all about table in Syncfusion ##Platform_Name## Document Editor component of Syncfusion Essential JS 2 and more.
55
platform: ej2-asp-core-mvc
66
control: Table
@@ -21,7 +21,109 @@ You can create and insert a table at cursor position by specifying the required
2121
documenteditor.editor.insertTable(3,3);
2222
```
2323

24-
The maximum size of row and column is limited to 32767 and 63 respectively.
24+
## Set the maximum number of Rows when inserting a table
25+
26+
{% if page.publishingplatform == "aspnet-core" %}
27+
28+
You can use the `maximumRows` property to set the maximum number of rows allowed while inserting a table in the Document Editor component.
29+
30+
Refer to the following sample code.
31+
32+
```ts
33+
<ejs-documenteditorcontainer id="container" serviceUrl="/api/DocumentEditor/" enableToolbar=true created="onCreated" height="590px"></ejs-documenteditorcontainer>
34+
35+
<script>
36+
var container;
37+
function onCreated() {
38+
var documenteditorElement = document.getElementById("container");
39+
container = documenteditorElement.ej2_instances[0];
40+
container.documentEditorSetting = {
41+
maximumRows: 4
42+
};
43+
}
44+
</script>
45+
```
46+
47+
{% elsif page.publishingplatform == "aspnet-mvc" %}
48+
49+
You can use the `maximumRows` property to set the maximum number of rows allowed while inserting a table in the Document Editor component.
50+
51+
```ts
52+
<div>
53+
@Html.EJS().DocumentEditorContainer("container").Created("onCreated").EnableToolbar(true).Render()
54+
</div>
55+
<script>
56+
var container;
57+
function onCreated() {
58+
var documenteditorElement = document.getElementById("container");
59+
container = documenteditorElement.ej2_instances[0];
60+
container.documentEditorSetting = {
61+
maximumRows: 4
62+
};
63+
}
64+
</script>
65+
```
66+
67+
{% endif %}
68+
69+
When the maximum row limit is reached, an alert will appear, as follow
70+
71+
![Row Limit Alert](images/Row_Limit_Alert.PNG)
72+
73+
>Note: The maximum value of Row is 32767, as per Microsoft Word application and you can set any value less than or equal to 32767 to this property.
74+
75+
## Set the maximum number of Columns when inserting a table
76+
77+
{% if page.publishingplatform == "aspnet-core" %}
78+
79+
You can use the `maximumColumns` property to set the maximum number of columns allowed while inserting a table in the Document Editor component.
80+
81+
Refer to the following sample code.
82+
83+
```ts
84+
<ejs-documenteditorcontainer id="container" serviceUrl="/api/DocumentEditor/" enableToolbar=true created="onCreated" height="590px"></ejs-documenteditorcontainer>
85+
86+
<script>
87+
var container;
88+
function onCreated() {
89+
var documenteditorElement = document.getElementById("container");
90+
container = documenteditorElement.ej2_instances[0];
91+
container.documentEditorSetting = {
92+
maximumColumns: 4
93+
};
94+
}
95+
</script>
96+
```
97+
98+
{% elsif page.publishingplatform == "aspnet-mvc" %}
99+
100+
You can use the `maximumColumns` property to set the maximum number of columns allowed while inserting a table in the Document Editor component.
101+
102+
Refer to the following sample code.
103+
104+
```ts
105+
<div>
106+
@Html.EJS().DocumentEditorContainer("container").Created("onCreated").EnableToolbar(true).Render()
107+
</div>
108+
<script>
109+
var container;
110+
function onCreated() {
111+
var documenteditorElement = document.getElementById("container");
112+
container = documenteditorElement.ej2_instances[0];
113+
container.documentEditorSetting = {
114+
maximumColumns: 4
115+
};
116+
}
117+
</script>
118+
```
119+
120+
{% endif %}
121+
122+
When the maximum column limit is reached, an alert will appear, as follow
123+
124+
![Column Limit Alert](images/Column_Limit_Alert.PNG)
125+
126+
>Note: The maximum value of Column is 63, as per Microsoft Word application and you can set any value less than or equal to 63 to this property.
25127
26128
## Insert rows
27129

@@ -145,7 +247,9 @@ The following sample demonstrates how to delete the table row or columns, merge
145247
{% include code-snippet/document-editor/table/tagHelper %}
146248
{% endhighlight %}
147249
{% highlight c# tabtitle="Table.cs" %}
148-
{% endhighlight %}{% endtabs %}
250+
{% include code-snippet/document-editor/table/document-editor.cs %}
251+
{% endhighlight %}
252+
{% endtabs %}
149253

150254
{% elsif page.publishingplatform == "aspnet-mvc" %}
151255

@@ -154,12 +258,14 @@ The following sample demonstrates how to delete the table row or columns, merge
154258
{% include code-snippet/document-editor/table/razor %}
155259
{% endhighlight %}
156260
{% highlight c# tabtitle="Table.cs" %}
157-
{% endhighlight %}{% endtabs %}
261+
{% include code-snippet/document-editor/table/document-editor.cs %}
262+
{% endhighlight %}
263+
{% endtabs %}
158264
{% endif %}
159265

160266

161267

162268
## See Also
163269

164270
* [Feature modules](../document-editor/feature-module/)
165-
* [Insert table dialog](../document-editor/dialog/#table-dialog)
271+
* [Insert table dialog](../document-editor/dialog/#table-dialog)

0 commit comments

Comments
 (0)