Display Table in README.md file in Git -Guidelines

readme table

Today in this article, we shall see how to Display Table in README.md file. We will also see how to format table content in block or align table text at the center or right or left of the table.

Tabular data representation is often a need for Application-specific technical documentation representing the capability of your API or application in the organization.

As we understood README file is a markup file that can be used to represent technical documentation or business documentation or architectural documentation as required

Today in this article, we will cover below aspects,

Readme.md file with markup codes lets you add all this content easily without any hassle.

Display Table in README.md

Let’s open readme.md file in edit mode within Git services like GitHub or Ado

Adding a table is easy using pipes and hyphens.

Please define your row and column as below,

| FirstName     | LastName      | City     |
| ------------- | ------------- | -------- |
| John          | Test1         | NewYork  |
| Bob           | Test2         | Toronto  |

Hyphens can be used to create each column’s header. Each column can be separated using pipes.

Display Table in READMEmd

Generated Table as below,

Add Table in git READMEmd

Please note below,

  • You need to add at least 3 hyphens to create each column properly.
  • You don’t necessarily perfectly align columns and hyphens.
  • You can format table as required in each column or row.

Formatting Table content in Bold in .md file

We can format Table content like table column name in bold or code block as below,

Display Table in README.md file in Git


| FirstName     | LastName      | City   
| ------------- | ------------- | --------    |
| `John`        | Test1         | `NewYork`   |
| `Bob`         | Test2         | `Toronto`   |

Generated table as below,

read me add Table git

Not above we have used ” to make the field look bold.

Align Table Column names at Center,Left, or Right in .md file

Align Cell text to the center or right or left of a column by using colons : to the center-left, right sides of the hyphens within the header row.

Right align     ---:

Left align       :---

Center align    :---:

| FirstName     | LastName      | City  |
| :------------ |   :---:       | --------: |
| `John`        | Test1         | `NewYork`   |
| `Bob`         | Test2         | `Los Angeles`   |

Display Table in READMEmd file

References :

Do you have any comments or ideas or any better suggestions to share?

Please sound off your comments below.

Happy Coding !!



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



Leave a Reply

Your email address will not be published. Required fields are marked *