Beginner [Exercise 2: Markdown tables] (Training slides exercise)

  • Build a table with 3 columns and 4 rows (5 including the header).
  • The first column should have a width value of 20% and be aligned to the left, the second one of 40% and aligned to the left and the third one should extend taking the remaining width of the page being aligned to the center.
  • The contents of the last row should be formatted in bold whilst the third column should be in italics (bear in mind that the total market share is both in bold and italics).
  • Use the text below to input the contents of the table and show the borders accordingly. The final output should look like this:

Solution:

{% stripnewlines %}
|Product
|Country
|Market share
{% newline %}
|---20%-----
|---40%-----
|:---------:+
{% newline %}
|] A 
|] Europe
|] *20%* [
{% newline %}
|] B 
|] Asia
|] *50%* [
{% newline %}
|] C
|] Africa
|] *30%* [
{% newline %}
|^^  ^^
|^^ **Total** ^^
|^^ ***100%*** ^^
{% endstripnewlines %}