একটি উপাদান যা একটি টেবিলকে প্রতিনিধিত্ব করে। একটি Table কেবল Table Row উপাদান থাকতে পারে। ডকুমেন্টের কাঠামো সম্পর্কে আরও তথ্যের জন্য, Google ডক্স সম্প্রসারণের নির্দেশিকা দেখুন।
যখন এমন একটি Table তৈরি করা হয় যেখানে প্রচুর সংখ্যক সারি বা কোষ থাকে, তখন এটি একটি স্ট্রিং অ্যারে থেকে তৈরি করার কথা বিবেচনা করুন, যেমনটি নিম্নলিখিত উদাহরণে দেখানো হয়েছে।
const body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody(); // Create a two-dimensional array containing the cell contents. const cells = [ ['Row 1, Cell 1', 'Row 1, Cell 2'], ['Row 2, Cell 1', 'Row 2, Cell 2'], ]; // Build a table from the array. body.appendTable(cells);
পদ্ধতি
| পদ্ধতি | রিটার্ন টাইপ | সংক্ষিপ্ত বিবরণ |
|---|---|---|
append Table Row() | Table Row | একটি নতুন Table Row তৈরি করে এবং যুক্ত করে। |
append Table Row(tableRow) | Table Row | প্রদত্ত Table Row যুক্ত করে। |
clear() | Table | এলিমেন্টের বিষয়বস্তু সাফ করে। |
copy() | Table | বর্তমান এলিমেন্টের একটি বিচ্ছিন্ন, গভীর অনুলিপি প্রদান করে। |
edit As Text() | Text | সম্পাদনার জন্য বর্তমান উপাদানের একটি Text সংস্করণ পায়। |
find Element(elementType) | Range Element |null | নির্দিষ্ট ধরণের বংশধরের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে। |
find Element(elementType, from) | Range Element |null | নির্দিষ্ট Range Element থেকে শুরু করে, নির্দিষ্ট ধরণের ডিসেন্ডেন্টের জন্য এলিমেন্টের বিষয়বস্তু অনুসন্ধান করে। |
find Text(searchPattern) | Range Element |null | রেগুলার এক্সপ্রেশন ব্যবহার করে নির্দিষ্ট টেক্সট প্যাটার্নের জন্য এলিমেন্টের বিষয়বস্তু অনুসন্ধান করে। |
find Text(searchPattern, from) | Range Element |null | একটি প্রদত্ত অনুসন্ধান ফলাফল থেকে শুরু করে, নির্দিষ্ট টেক্সট প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে। |
get Attributes() | Object | উপাদানের বৈশিষ্ট্যগুলি পুনরুদ্ধার করে। |
get Border Color() | String|null | সীমানার রঙ পুনরুদ্ধার করে। |
get Border Width() | Number|null | পয়েন্টে সীমানার প্রস্থ পুনরুদ্ধার করে। |
get Cell(rowIndex, cellIndex) | Table Cell |null | নির্দিষ্ট সারি এবং ঘর সূচকে Table Cell পুনরুদ্ধার করে। |
get Child(childIndex) | Element | নির্দিষ্ট শিশু সূচকে শিশু উপাদানটি পুনরুদ্ধার করে। |
get Child Index(child) | Integer | নির্দিষ্ট শিশু উপাদানের জন্য শিশু সূচক পুনরুদ্ধার করে। |
get Column Width(columnIndex) | Number|null | নির্দিষ্ট টেবিল কলামের প্রস্থ, পয়েন্টে পুনরুদ্ধার করে। |
get Link Url() | String|null | লিঙ্কের URL উদ্ধার করে। |
get Next Sibling() | Element |null | এলিমেন্টের পরবর্তী সিবলিং এলিমেন্ট উদ্ধার করে। |
get Num Children() | Integer | শিশুদের সংখ্যা উদ্ধার করে। |
get Num Rows() | Integer | Table Rows সংখ্যা পুনরুদ্ধার করে। |
get Parent() | Container Element |null | এলিমেন্টের প্যারেন্ট এলিমেন্ট উদ্ধার করে। |
get Previous Sibling() | Element |null | এলিমেন্টের পূর্ববর্তী ভাইবোন এলিমেন্ট উদ্ধার করে। |
get Row(rowIndex) | Table Row |null | নির্দিষ্ট সারি সূচীতে Table Row পুনরুদ্ধার করে। |
get Text() | String | এলিমেন্টের বিষয়বস্তু একটি টেক্সট স্ট্রিং হিসেবে উদ্ধার করে। |
get Text Alignment() | Text Alignment |null | টেক্সট অ্যালাইনমেন্ট পায়। |
get Type() | Element Type | উপাদানটির Element Type উদ্ধার করে। |
insert Table Row(childIndex) | Table Row | নির্দিষ্ট সূচীতে একটি নতুন Table Row তৈরি করে এবং সন্নিবেশ করায়। |
insert Table Row(childIndex, tableRow) | Table Row | নির্দিষ্ট সূচীতে প্রদত্ত Table Row সন্নিবেশ করায়। |
is At Document End() | Boolean | উপাদানটি Document শেষে আছে কিনা তা নির্ধারণ করে। |
remove Child(child) | Table | নির্দিষ্ট শিশু উপাদানটি সরিয়ে দেয়। |
remove From Parent() | Table |null | উপাদানটিকে তার মূল উপাদান থেকে সরিয়ে দেয়। |
remove Row(rowIndex) | Table Row | নির্দিষ্ট সারি সূচীতে Table Row সরিয়ে দেয়। |
replace Text(searchPattern, replacement) | Element | রেগুলার এক্সপ্রেশন ব্যবহার করে, একটি প্রদত্ত টেক্সট প্যাটার্নের সমস্ত ঘটনাকে একটি প্রদত্ত প্রতিস্থাপন স্ট্রিং দিয়ে প্রতিস্থাপন করে। |
set Attributes(attributes) | Table | এলিমেন্টের বৈশিষ্ট্য নির্ধারণ করে। |
set Border Color(color) | Table | সীমানার রঙ সেট করে। |
set Border Width(width) | Table | সীমানার প্রস্থকে পয়েন্টে সেট করে। |
set Column Width(columnIndex, width) | Table | নির্দিষ্ট কলামের প্রস্থ পয়েন্টে সেট করে। |
set Link Url(url) | Table | লিঙ্কের url সেট করে। |
set Text Alignment(textAlignment) | Table | টেক্সট অ্যালাইনমেন্ট সেট করে। |
বিস্তারিত ডকুমেন্টেশন
append Table Row()
append Table Row(tableRow)
প্রদত্ত Table Row যুক্ত করে।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table in the tab and copies the second row. const table = body.getTables()[0]; const row = table.getChild(1).copy(); // Adds the copied row to the bottom of the table. const tableRow = table.appendTableRow(row);
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
table Row | Table Row | যোগ করার জন্য টেবিলের সারি। |
প্রত্যাবর্তন
Table Row — সংযুক্ত টেবিল সারি উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
clear()
copy()
বর্তমান এলিমেন্টের একটি বিচ্ছিন্ন, গভীর অনুলিপি প্রদান করে।
এলিমেন্টে উপস্থিত যেকোনো চাইল্ড এলিমেন্টও কপি করা হয়। নতুন এলিমেন্টের কোন প্যারেন্ট নেই।
প্রত্যাবর্তন
Table — নতুন কপি।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
edit As Text()
সম্পাদনার জন্য বর্তমান উপাদানের একটি Text সংস্করণ পায়।
এলিমেন্টের কন্টেন্টগুলিকে রিচ টেক্সট হিসেবে ব্যবহার করার জন্য edit As Text ব্যবহার করুন। edit As Text মোড নন-টেক্সট এলিমেন্টগুলিকে (যেমন Inline Image এবং Horizontal Rule ) উপেক্ষা করে।
মুছে ফেলা টেক্সট রেঞ্জের মধ্যে সম্পূর্ণরূপে থাকা চাইল্ড এলিমেন্টগুলি এলিমেন্ট থেকে সরানো হয়।
const body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody(); // Insert two paragraphs separated by a paragraph containing an // horizontal rule. body.insertParagraph(0, 'An editAsText sample.'); body.insertHorizontalRule(0); body.insertParagraph(0, 'An example.'); // Delete " sample.\n\n An" removing the horizontal rule in the process. body.editAsText().deleteText(14, 25);
প্রত্যাবর্তন
Text — বর্তমান এলিমেন্টের একটি টেক্সট ভার্সন
find Element(elementType)
নির্দিষ্ট ধরণের বংশধরের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
element Type | Element Type | যে ধরণের উপাদান অনুসন্ধান করতে হবে। |
প্রত্যাবর্তন
Range Element |null — একটি সার্চ ফলাফল যা সার্চ এলিমেন্টের অবস্থান নির্দেশ করে।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
find Element(elementType, from)
নির্দিষ্ট Range Element থেকে শুরু করে, নির্দিষ্ট ধরণের ডিসেন্ডেন্টের জন্য এলিমেন্টের বিষয়বস্তু অনুসন্ধান করে।
const body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody(); // Define the search parameters. let searchResult = null; // Search until the paragraph is found. while ( (searchResult = body.findElement( DocumentApp.ElementType.PARAGRAPH, searchResult, ))) { const par = searchResult.getElement().asParagraph(); if (par.getHeading() === DocumentApp.ParagraphHeading.HEADING1) { // Found one, update and stop. par.setText('This is the first header.'); break; } }
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
element Type | Element Type | যে ধরণের উপাদান অনুসন্ধান করতে হবে। |
from | Range Element | যে অনুসন্ধান ফলাফল থেকে অনুসন্ধান করা হবে। |
প্রত্যাবর্তন
Range Element |null — একটি সার্চ ফলাফল যা সার্চ এলিমেন্টের পরবর্তী অবস্থান নির্দেশ করে।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
find Text(searchPattern)
রেগুলার এক্সপ্রেশন ব্যবহার করে নির্দিষ্ট টেক্সট প্যাটার্নের জন্য এলিমেন্টের বিষয়বস্তু অনুসন্ধান করে।
জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন বৈশিষ্ট্যগুলির একটি উপসেট সম্পূর্ণরূপে সমর্থিত নয়, যেমন ক্যাপচার গ্রুপ এবং মোড মডিফায়ার।
প্রদত্ত রেগুলার এক্সপ্রেশন প্যাটার্নটি বর্তমান এলিমেন্টে থাকা প্রতিটি টেক্সট ব্লকের সাথে স্বাধীনভাবে মিলে যায়।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
search Pattern | String | যে প্যাটার্নটি খুঁজতে হবে |
প্রত্যাবর্তন
Range Element |null — একটি সার্চ ফলাফল যা সার্চ টেক্সটের অবস্থান নির্দেশ করে, অথবা যদি কোন মিল না থাকে তাহলে নাল
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
find Text(searchPattern, from)
একটি প্রদত্ত অনুসন্ধান ফলাফল থেকে শুরু করে, নির্দিষ্ট টেক্সট প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।
জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন বৈশিষ্ট্যগুলির একটি উপসেট সম্পূর্ণরূপে সমর্থিত নয়, যেমন ক্যাপচার গ্রুপ এবং মোড মডিফায়ার।
প্রদত্ত রেগুলার এক্সপ্রেশন প্যাটার্নটি বর্তমান এলিমেন্টে থাকা প্রতিটি টেক্সট ব্লকের সাথে স্বাধীনভাবে মিলে যায়।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
search Pattern | String | যে প্যাটার্নটি খুঁজতে হবে |
from | Range Element | যে অনুসন্ধান ফলাফল থেকে অনুসন্ধান করা হবে |
প্রত্যাবর্তন
Range Element |null — একটি সার্চ রেজাল্ট যা সার্চ টেক্সটের পরবর্তী অবস্থান নির্দেশ করে, অথবা যদি কোন মিল না থাকে তাহলে নাল।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Attributes()
উপাদানের বৈশিষ্ট্যগুলি পুনরুদ্ধার করে।
ফলাফল হল প্রতিটি বৈধ উপাদান বৈশিষ্ট্যের জন্য একটি বৈশিষ্ট্য ধারণকারী একটি বস্তু যেখানে প্রতিটি বৈশিষ্ট্যের নাম Document App.Attribute একটি আইটেমের সাথে মিলে যায়। অ্যাট্রিবিউট গণনা।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Append a styled paragraph. const par = body.appendParagraph('A bold, italicized paragraph.'); par.setBold(true); par.setItalic(true); // Retrieve the paragraph's attributes. const atts = par.getAttributes(); // Log the paragraph attributes. for (const att in atts) { Logger.log(`${att}:${atts[att]}`); }
প্রত্যাবর্তন
Object — উপাদানের বৈশিষ্ট্য।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Border Color()
সীমানার রঙ পুনরুদ্ধার করে।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table. const table = body.getTables()[0]; // Sets the border color of the first table. table.setBorderColor('#00FF00'); // Logs the border color of the first table to the console. console.log(table.getBorderColor());
প্রত্যাবর্তন
String|null — সীমানার রঙ, CSS নোটেশনে ফর্ম্যাট করা (যেমন '#ffffff' )।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Border Width()
পয়েন্টে সীমানার প্রস্থ পুনরুদ্ধার করে।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table. const table = body.getTables()[0]; // Sets the border width of the first table. table.setBorderWidth(20); // Logs the border width of the first table. console.log(table.getBorderWidth());
প্রত্যাবর্তন
Number|null — সীমানার প্রস্থ, বিন্দুতে।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Cell(rowIndex, cellIndex)
নির্দিষ্ট সারি এবং ঘর সূচকে Table Cell পুনরুদ্ধার করে।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table. const table = body.getTables()[0]; // Gets the cell of the table's third row and second column. const cell = table.getCell(2, 1); // Logs the cell text to the console. console.log(cell.getText());
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
row Index | Integer | যে ঘরটি পুনরুদ্ধার করতে হবে সেই সারির সূচী। |
cell Index | Integer | যে কক্ষটি উদ্ধার করা হবে তার সূচক। |
প্রত্যাবর্তন
Table Cell |null — টেবিল সেল।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Child(childIndex)
নির্দিষ্ট শিশু সূচকে শিশু উপাদানটি পুনরুদ্ধার করে।
const body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody(); // Obtain the first element in the tab. const firstChild = body.getChild(0); // If it's a paragraph, set its contents. if (firstChild.getType() === DocumentApp.ElementType.PARAGRAPH) { firstChild.asParagraph().setText('This is the first paragraph.'); }
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
child Index | Integer | যে চাইল্ড এলিমেন্টটি উদ্ধার করা হবে তার সূচী। |
প্রত্যাবর্তন
Element — নির্দিষ্ট সূচীতে থাকা চাইল্ড এলিমেন্ট।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Child Index(child)
নির্দিষ্ট শিশু উপাদানের জন্য শিশু সূচক পুনরুদ্ধার করে।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
child | Element | যে চাইল্ড এলিমেন্টের জন্য ইনডেক্সটি পুনরুদ্ধার করা হবে। |
প্রত্যাবর্তন
Integer — শিশু সূচক।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Column Width(columnIndex)
নির্দিষ্ট টেবিল কলামের প্রস্থ, পয়েন্টে পুনরুদ্ধার করে।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table. const table = body.getTables()[0]; // Sets the width of the second column to 100 points. const columnWidth = table.setColumnWidth(1, 100); // Gets the width of the second column and logs it to the console. console.log(columnWidth.getColumnWidth(1));
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
column Index | Integer | কলাম সূচক। |
প্রত্যাবর্তন
Number|null — কলামের প্রস্থ, বিন্দুতে।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Link Url()
লিঙ্কের URL উদ্ধার করে।
প্রত্যাবর্তন
String|null — লিঙ্ক url, অথবা null যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Next Sibling()
এলিমেন্টের পরবর্তী সিবলিং এলিমেন্ট উদ্ধার করে।
পরবর্তী ভাইবোনের একই পিতামাতা আছে এবং বর্তমান উপাদানটি অনুসরণ করে।
প্রত্যাবর্তন
Element |null — পরবর্তী সহোদর উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Num Children()
শিশুদের সংখ্যা উদ্ধার করে।
const body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody(); // Log the number of elements in the tab. Logger.log(`There are ${body.getNumChildren()} elements in the tab's body.`);
প্রত্যাবর্তন
Integer — শিশুদের সংখ্যা।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Num Rows()
Table Rows সংখ্যা পুনরুদ্ধার করে।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table. const table = body.getTables()[0]; // Logs the number of rows of the first table to the console. console.log(table.getNumRows());
প্রত্যাবর্তন
Integer — টেবিলের সারির সংখ্যা।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Parent()
এলিমেন্টের প্যারেন্ট এলিমেন্ট উদ্ধার করে।
প্যারেন্ট এলিমেন্টে বর্তমান এলিমেন্ট থাকে।
প্রত্যাবর্তন
Container Element |null — মূল এলিমেন্ট।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Previous Sibling()
এলিমেন্টের পূর্ববর্তী ভাইবোন এলিমেন্ট উদ্ধার করে।
পূর্ববর্তী ভাইবোনের একই প্যারেন্ট আছে এবং বর্তমান এলিমেন্টের আগে থাকে।
প্রত্যাবর্তন
Element |null — পূর্ববর্তী সহোদর উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Row(rowIndex)
নির্দিষ্ট সারি সূচীতে Table Row পুনরুদ্ধার করে।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table and logs the text of first row to the console. const table = body.getTables()[0]; console.log(table.getRow(0).getText());
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
row Index | Integer | যে সারির সূচী উদ্ধার করা হবে। |
প্রত্যাবর্তন
Table Row |null — টেবিল সারি।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Text()
এলিমেন্টের বিষয়বস্তু একটি টেক্সট স্ট্রিং হিসেবে উদ্ধার করে।
প্রত্যাবর্তন
String — টেক্সট স্ট্রিং হিসেবে এলিমেন্টের বিষয়বস্তু
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Text Alignment()
টেক্সট অ্যালাইনমেন্ট পায়। অ্যালাইনমেন্টের উপলব্ধ ধরণগুলি হল Document App.TextAlignment.NORMAL , Document App.TextAlignment.SUBSCRIPT , এবং Document App.TextAlignment.SUPERSCRIPT ।
প্রত্যাবর্তন
Text Alignment |null — টেক্সট অ্যালাইনমেন্টের ধরণ, অথবা যদি টেক্সটে একাধিক ধরণের টেক্সট অ্যালাইনমেন্ট থাকে অথবা যদি টেক্সট অ্যালাইনমেন্ট কখনও সেট করা না থাকে তাহলে null
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Type()
উপাদানটির Element Type উদ্ধার করে।
একটি নির্দিষ্ট উপাদানের সঠিক ধরণ নির্ধারণ করতে get Type() ব্যবহার করুন।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Obtain the first element in the active tab's body. const firstChild = body.getChild(0); // Use getType() to determine the element's type. if (firstChild.getType() === DocumentApp.ElementType.PARAGRAPH) { Logger.log('The first element is a paragraph.'); } else { Logger.log('The first element is not a paragraph.'); }
প্রত্যাবর্তন
Element Type — এলিমেন্টের ধরণ।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
insert Table Row(childIndex)
নির্দিষ্ট সূচীতে একটি নতুন Table Row তৈরি করে এবং সন্নিবেশ করায়।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
child Index | Integer | যে সূচকে উপাদানটি সন্নিবেশ করাতে হবে |
প্রত্যাবর্তন
Table Row — বর্তমান উপাদান
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
insert Table Row(childIndex, tableRow)
নির্দিষ্ট সূচীতে প্রদত্ত Table Row সন্নিবেশ করায়।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
child Index | Integer | যে সূচকে উপাদানটি সন্নিবেশ করাতে হবে |
table Row | Table Row | সন্নিবেশ করানোর জন্য টেবিলের সারি |
প্রত্যাবর্তন
Table Row — সন্নিবেশিত টেবিল সারি উপাদান
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
is At Document End()
উপাদানটি Document শেষে আছে কিনা তা নির্ধারণ করে।
প্রত্যাবর্তন
Boolean — উপাদানটি ট্যাবের শেষে আছে কিনা।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
remove Child(child)
নির্দিষ্ট শিশু উপাদানটি সরিয়ে দেয়।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table. const table = body.getTables()[0]; // Finds the first table row and removes it. const element = table.findElement(DocumentApp.ElementType.TABLE_ROW); table.removeChild(element.getElement());
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
child | Element | যে চাইল্ড এলিমেন্টটি অপসারণ করতে হবে। |
প্রত্যাবর্তন
Table — বর্তমান উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
remove From Parent()
উপাদানটিকে তার মূল উপাদান থেকে সরিয়ে দেয়।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Remove all images in the active tab's body. const imgs = body.getImages(); for (let i = 0; i < imgs.length; i++) { imgs[i].removeFromParent(); }
প্রত্যাবর্তন
Table |null — সরানো উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
remove Row(rowIndex)
নির্দিষ্ট সারি সূচীতে Table Row সরিয়ে দেয়।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table and removes its second row. const table = body.getTables()[0]; table.removeRow(1);
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
row Index | Integer | সরানোর জন্য সারির সূচী। |
প্রত্যাবর্তন
Table Row — সরানো সারি।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
replace Text(searchPattern, replacement)
রেগুলার এক্সপ্রেশন ব্যবহার করে, একটি প্রদত্ত টেক্সট প্যাটার্নের সমস্ত ঘটনাকে একটি প্রদত্ত প্রতিস্থাপন স্ট্রিং দিয়ে প্রতিস্থাপন করে।
অনুসন্ধান প্যাটার্নটি জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন অবজেক্ট নয়, বরং একটি স্ট্রিং হিসেবে পাস করা হয়। এর ফলে আপনাকে প্যাটার্নে যেকোনো ব্যাকস্ল্যাশ এড়াতে হবে।
এই পদ্ধতিগুলি Google এর RE2 রেগুলার এক্সপ্রেশন লাইব্রেরি ব্যবহার করে, যা সমর্থিত সিনট্যাক্সকে সীমিত করে।
প্রদত্ত রেগুলার এক্সপ্রেশন প্যাটার্নটি বর্তমান এলিমেন্টে থাকা প্রতিটি টেক্সট ব্লকের সাথে স্বাধীনভাবে মিলে যায়।
const body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody(); // Clear the text surrounding "Apps Script", with or without text. body.replaceText('^.*Apps ?Script.*$', 'Apps Script');
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
search Pattern | String | অনুসন্ধানের জন্য রেজেক্স প্যাটার্ন |
replacement | String | প্রতিস্থাপন হিসেবে ব্যবহার করার জন্য লেখাটি |
প্রত্যাবর্তন
Element — বর্তমান উপাদান
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
set Attributes(attributes)
এলিমেন্টের বৈশিষ্ট্য নির্ধারণ করে।
নির্দিষ্ট অ্যাট্রিবিউট প্যারামিটারটি অবশ্যই এমন একটি অবজেক্ট হতে হবে যেখানে প্রতিটি প্রোপার্টির নাম Document App.Attribute একটি আইটেম। অ্যাট্রিবিউট গণনা এবং প্রতিটি প্রোপার্টির মান হল প্রয়োগ করা নতুন মান।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Define a custom paragraph style. const style = {}; style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] = DocumentApp.HorizontalAlignment.RIGHT; style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri'; style[DocumentApp.Attribute.FONT_SIZE] = 18; style[DocumentApp.Attribute.BOLD] = true; // Append a plain paragraph. const par = body.appendParagraph('A paragraph with custom style.'); // Apply the custom style. par.setAttributes(style);
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
attributes | Object | উপাদানটির বৈশিষ্ট্য। |
প্রত্যাবর্তন
Table — বর্তমান উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
set Border Color(color)
সীমানার রঙ সেট করে।
// Opens the Docs file by its ID. If you created your script from within a // Google Docs file, you can use DocumentApp.getActiveDocument() instead. // TODO(developer): Replace the ID with your own. const doc = DocumentApp.openById('123abc'); // Gets the body contents of the tab by its ID. // TODO(developer): Replace the ID with your own. const body = doc.getTab('123abc').asDocumentTab().getBody(); // Gets the first table. const table = body.getTables()[0]; // Sets the border color of the table to green. table.setBorderColor('#00FF00');
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
color | String | সীমানার রঙ, CSS নোটেশনে ফর্ম্যাট করা (যেমন '#ffffff' )। |
প্রত্যাবর্তন
Table — বর্তমান উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
set Border Width(width)
সীমানার প্রস্থকে পয়েন্টে সেট করে।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
width | Number | সীমানার প্রস্থ, বিন্দুতে |
প্রত্যাবর্তন
Table — বর্তমান উপাদান
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
set Column Width(columnIndex, width)
নির্দিষ্ট কলামের প্রস্থ পয়েন্টে সেট করে।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
column Index | Integer | কলাম সূচক |
width | Number | সীমানার প্রস্থ, বিন্দুতে |
প্রত্যাবর্তন
Table — বর্তমান উপাদান
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
set Link Url(url)
লিঙ্কের url সেট করে।
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
url | String | লিঙ্কের ইউআরএল |
প্রত্যাবর্তন
Table — বর্তমান উপাদান
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
set Text Alignment(textAlignment)
টেক্সট অ্যালাইনমেন্ট সেট করে। অ্যালাইনমেন্টের উপলব্ধ ধরণগুলি হল Document App.TextAlignment.NORMAL , Document App.TextAlignment.SUBSCRIPT , এবং Document App.TextAlignment.SUPERSCRIPT ।
// Make the entire first paragraph in the active tab be superscript. const documentTab = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab(); const text = documentTab.getBody().getParagraphs()[0].editAsText(); text.setTextAlignment(DocumentApp.TextAlignment.SUPERSCRIPT);
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
text Alignment | Text Alignment | প্রয়োগ করার জন্য টেক্সট অ্যালাইনমেন্টের ধরণ |
প্রত্যাবর্তন
Table — বর্তমান উপাদান
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents