1
1
---
2
2
layout : post
3
- title : Table in # #Platform_Name## Document Editor Component
3
+ title : Table in # #Platform_Name## Document Editor Component | Syncfusion
4
4
description : Learn here all about table in Syncfusion # #Platform_Name## Document Editor component of Syncfusion Essential JS 2 and more.
5
5
platform : ej2-asp-core-mvc
6
6
control : Table
@@ -21,7 +21,109 @@ You can create and insert a table at cursor position by specifying the required
21
21
documenteditor .editor .insertTable (3 ,3 );
22
22
```
23
23
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.
25
127
26
128
## Insert rows
27
129
@@ -145,7 +247,9 @@ The following sample demonstrates how to delete the table row or columns, merge
145
247
{% include code-snippet/document-editor/table/tagHelper %}
146
248
{% endhighlight %}
147
249
{% highlight c# tabtitle="Table.cs" %}
148
- {% endhighlight %}{% endtabs %}
250
+ {% include code-snippet/document-editor/table/document-editor.cs %}
251
+ {% endhighlight %}
252
+ {% endtabs %}
149
253
150
254
{% elsif page.publishingplatform == "aspnet-mvc" %}
151
255
@@ -154,12 +258,14 @@ The following sample demonstrates how to delete the table row or columns, merge
154
258
{% include code-snippet/document-editor/table/razor %}
155
259
{% endhighlight %}
156
260
{% highlight c# tabtitle="Table.cs" %}
157
- {% endhighlight %}{% endtabs %}
261
+ {% include code-snippet/document-editor/table/document-editor.cs %}
262
+ {% endhighlight %}
263
+ {% endtabs %}
158
264
{% endif %}
159
265
160
266
161
267
162
268
## See Also
163
269
164
270
* [ 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