rhazdon / hugo-theme-hello-friend-ng

Pretty basic theme for Hugo that covers all of the essentials. All you have to do is start typing!
https://github.com/rhazdon/hugo-theme-hello-friend-ng/
Other
1.46k stars 777 forks source link

[Question] Aliging tables preferences #322

Closed Manbearpiet closed 2 years ago

Manbearpiet commented 3 years ago

Hi thanks again for the theme rhazdon. I hope you enjoyed the coffee hehe.

I have the following challenge which my google-fu couldn't solve. My blog uses your theme and I write my content in markdown. However when I create a table it always centers the whole table. Is there a way to align it left, right or center? My content is not very broad, center looks a bit funky then.

I tried stuff like

<div align="left">
table
</div>

and

<left>
table
</left>

But that didn't help.

I saw similar threads where they advised using raw-HTML, is that the only way? Or is there another approach?

Thanks in advance and keep up the awesome work!

HacDan commented 3 years ago

From what I can tell, this is due to the auto left and right margin's being set on \<table>'s referenced here:

https://github.com/rhazdon/hugo-theme-hello-friend-ng/blob/57bd108819c412e1099ba090a92569e530867619/assets/scss/_tables.scss#L1-L9

Changing the auto left/right margin to say 0px causes the table to left justify. I'm not sure if this is necessarily the correct solution but would apply to all of your tables, presumably that's what you're wanting to do.