From: Vladimír Vondruš Date: Wed, 17 Jan 2018 00:40:28 +0000 (+0100) Subject: css: ability to align text vertically in a table cell. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=03b436ee609ce8898b68f2cdbb6a8f3cd441dee1;p=blog.git css: ability to align text vertically in a table cell. --- diff --git a/css/m-components.css b/css/m-components.css index 76f605af..f4318af2 100644 --- a/css/m-components.css +++ b/css/m-components.css @@ -584,6 +584,15 @@ div.m-scroll { .m-text-right, .m-text-right.m-noindent, table.m-table th.m-text-right, .m-text-right p { text-align: right; } +.m-text-top, table.m-table th.m-text-top, table.m-table td.m-text-top { + vertical-align: top; +} +.m-text-middle, table.m-table th.m-text-middle, table.m-table td.m-text-middle { + vertical-align: middle; +} +.m-text-bottom, table.m-table th.m-text-bottom, table.m-table td.m-text-bottom { + vertical-align: bottom; +} .m-text.m-small { font-size: 85.4%; } diff --git a/doc/css/typography.rst b/doc/css/typography.rst index 091f741c..6b847db5 100644 --- a/doc/css/typography.rst +++ b/doc/css/typography.rst @@ -373,9 +373,10 @@ will have negative margin to make its contents aligned with surrounding text. ================= Use :css:`.m-text-left`, :css:`.m-text-right` or :css:`.m-text-center` to -align text inside its parent element. See -`Floating around <{filename}/css/grid.rst#floating-around>`_ in the grid system -for aligning and floating blocks in a similar way. +align text inside its parent element. Use :css:`.m-text-top`, +:css:`.m-text-middle` and :css:`.m-text-bottom` to align text vertically for +example in a table cell. See `Floating around <{filename}/css/grid.rst#floating-around>`_ +in the grid system for aligning and floating blocks in a similar way. `Padding`_ ==========