Tabular Output
Sometimes it's necessary to generate the output in some specific format: table, list, structured text with headers/titles, etc. ChatGPT is able to provide such an output and now we will consider corresponding prompts.
Let's start from the tabular output.
Simple tabular output
Input Prompt:
Create a table with the following columns: name, age, profession. Fill in this table with some random values.
Generated Output:
Name | Age | Profession |
---|---|---|
John Smith | 32 | Engineer |
Alice Johnson | 28 | Teacher |
Michael Brown | 45 | Doctor |
Emily Davis | 37 | Lawyer |
HTML table
We can ask ChatGPT to generate table in HTML format:
Input Prompt:
Create me a table with the following columns: name, age, profession and fill this table with some random values. This table must be created in HTML format.
Generated Output:
<!DOCTYPE html>
<html>
<head>
<title>Random Data Table</title>
</head>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
<th>Profession</th>
</tr>
<tr>
<td>John Smith</td>
<td>32</td>
<td>Engineer</td>
</tr>
<tr>
<td>Alice Johnson</td>
<td>28</td>
<td>Teacher</td>
</tr>
<tr>
<td>Michael Brown</td>
<td>45</td>
<td>Doctor</td>
</tr>
<tr>
<td>Emily Davis</td>
<td>37</td>
<td>Lawyer</td>
</tr>
</table>
</body>
</html>
Markdown tables
We can also generate tables in Markdown format using ChatGPT:
Input Prompt:
Create me a table with the following columns: Name, age, profession and fill this table with some random values. This table must be created in Markdown format.
Generated Output:
| Name | Age | Profession | |:--------:|:-----:|:------------:| | Alice | 28 | Engineer | | Bob | 35 | Teacher | | Charlie | 42 | Doctor | | David | 31 | Artist | | Emily | 29 | Lawyer |
¿Todo estuvo claro?
Contenido del Curso
Introduction to Chat GPT
3. Formatting the Output of the Chat
Introduction to Chat GPT
Tabular Output
Sometimes it's necessary to generate the output in some specific format: table, list, structured text with headers/titles, etc. ChatGPT is able to provide such an output and now we will consider corresponding prompts.
Let's start from the tabular output.
Simple tabular output
Input Prompt:
Create a table with the following columns: name, age, profession. Fill in this table with some random values.
Generated Output:
Name | Age | Profession |
---|---|---|
John Smith | 32 | Engineer |
Alice Johnson | 28 | Teacher |
Michael Brown | 45 | Doctor |
Emily Davis | 37 | Lawyer |
HTML table
We can ask ChatGPT to generate table in HTML format:
Input Prompt:
Create me a table with the following columns: name, age, profession and fill this table with some random values. This table must be created in HTML format.
Generated Output:
<!DOCTYPE html>
<html>
<head>
<title>Random Data Table</title>
</head>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
<th>Profession</th>
</tr>
<tr>
<td>John Smith</td>
<td>32</td>
<td>Engineer</td>
</tr>
<tr>
<td>Alice Johnson</td>
<td>28</td>
<td>Teacher</td>
</tr>
<tr>
<td>Michael Brown</td>
<td>45</td>
<td>Doctor</td>
</tr>
<tr>
<td>Emily Davis</td>
<td>37</td>
<td>Lawyer</td>
</tr>
</table>
</body>
</html>
Markdown tables
We can also generate tables in Markdown format using ChatGPT:
Input Prompt:
Create me a table with the following columns: Name, age, profession and fill this table with some random values. This table must be created in Markdown format.
Generated Output:
| Name | Age | Profession | |:--------:|:-----:|:------------:| | Alice | 28 | Engineer | | Bob | 35 | Teacher | | Charlie | 42 | Doctor | | David | 31 | Artist | | Emily | 29 | Lawyer |
¿Todo estuvo claro?