We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Markdown table headings forced to align left

Developer Preview

kmartens's avatar
kmartens
155 posts
6 years ago
kmartens's avatar kmartens

I’m using a feature comparison chart to show the differences between each edition of Freeform, and I have specified :---: etc to align some content centered. I can see that a class of center is being applied to table headings and body rows, but the heading rows remain left-aligned, apparently due to some CSS in default.min.css that’s overriding it. Any chance this can be adjusted? :D

https://expressionengine.com/add-ons/freeform

Obviously not end-of-the-world, but looks a little ugly.

       
James Mathias's avatar
James Mathias
225 posts
6 years ago
James Mathias's avatar James Mathias

Place a class of compare on the table itself, and a class of txt-center on the ths you want to have centered text.

You can also put a class of yes on a td with an empty span in the td to get a checkmark, and a class of no with an empty span in the td to get a x.

       
kmartens's avatar
kmartens
155 posts
6 years ago
kmartens's avatar kmartens

Thanks… I am using markdown for the formatting of the table though, so I can’t actually apply any classes… or are you suggesting I switch the whole thing to HTML?

       
James Mathias's avatar
James Mathias
225 posts
6 years ago
James Mathias's avatar James Mathias

If you’d like to have a comparison table in your listing you’ll need to use HTML with classes I suggested above, or be ok with the styles as applied to an un-classed table.

       
kmartens's avatar
kmartens
155 posts
6 years ago
kmartens's avatar kmartens

Thanks

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

For reference, Markdown Extra allows for some attributes on some elements, but Markdown-based tables is not one of them.

https://michelf.ca/projects/php-markdown/extra/#spe-attr

       
kmartens's avatar
kmartens
155 posts
6 years ago
kmartens's avatar kmartens

Interesting, thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.