How to Change Cell Alignment for Tables in Jekyll
Today, I changed the alignment of table cells on my site from centered (the default) to top of the cell by adding the following CSS:
td {
vertical-align: top;
}
I use tables extensively to summarize legal rules, so a cell can have several lines of text that I separate using two HTML breaks (<br><br>
). Aligning the text to the top of the cell makes the table easier to read.
I’m using the default Jekyll theme, Minima. I added the CSS to to this file : _sass > minima > custom-styles.scss
For more using CSS to change the alignment of text in a table, see CSS Table Alignment, W3Schools.