HTML

A guide to working with HTML in Kognitos.

HTML Operations

This guide provides a step-by-step overview of performing HTML operations in Kognitos. It covers creating, modifying, and deleting HTML tables, as well as generating HTML files.

1. Getting Data from HTML Files

To read the content of an HTML file, use the following syntax:

get the file
get the file's content
  1. get the file: This phrase will prompt you to upload an .html file.
  2. get the file's content: This phrase retrieves the content of the provided HTML file.

2. Getting Data From HTML Tables

To fetch data from HTML tables using Kognitos, use this syntax:

the html is "<html><body><table><tr><th>Header1</th><th>Header2</th></tr><tr><td>Row1Col1</td><td>Row1Col2</td></tr></table></body></html>"
get the html's tables

3. Creating and Modifying HTML Tables

3.1. Adding a New Row

To add a new row to an HTML table, you need to specify the table and provide the necessary cell values. For example:

the html is "<html><body><table id='myTable'><tr><th>Header1</th><th>Header2</th></tr></table></body></html>"
add a row to the table with
    the cell values are "NewRow1Col1", "NewRow1Col2"

This command adds a new row with the specified cell values to the table with the ID myTable.

3.2. Updating Existing Rows

To update an existing row in an HTML table, you must identify the row by its index and specify the new cell values. For example:

the html is "<html><body><table id='myTable'><tr><th>Header1</th><th>Header2</th></tr><tr><td>Row1Col1</td><td>Row1Col2</td></tr></table></body></html>"
update the row at index 1 in the table with
    the cell values are "UpdatedRow1Col1", "UpdatedRow1Col2"

This command updates the first row of the table with the new cell values.


4. Deleting HTML Tables

4.1. Single Deletion

To delete a specific HTML table, you need to specify the table by its ID. For example:

the html is "<html><body><table id='myTable'><tr><th>Header1</th><th>Header2</th></tr></table></body></html>"
delete the table with id "myTable"

This command deletes the table with the specified ID "myTable".


5. Convert Text to HTML

You can create an HTML file by converting text into HTML. This is done with the phrase convert the text to an html file. For example:

the text is "<html><body>Hello, world!</body></html>"
convert the text to an html file

Note: The text must be valid-formatted HTML.