How can I center a table on a regular page?

Solved

How can I center a table on a regular page?

miltokas
Explorer
106 0 32

Hi there!

I am trying to center a table in a page but when I use the align option of the editor it only applies to the content of the table, not to the table itself.

I have tried all possible solutions here in the forum but none of them has worked out.

Do you have any ideas? Thanks!

 

Theme: Dawn

Page: https://venga-store.com/pages/men-shirts-size-chart

 

miltokas_0-1710086601092.png

 

 

Accepted Solution (1)

niraj_patel
Shopify Partner
2391 516 516

This is an accepted solution.

Hello @miltokas 

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
<style>
 table:not([class]) {
   margin: 0 auto !important;
 }
</style>

techlyser_web_0-1710087404692.png

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com

View solution in original post

Replies 4 (4)

Guleria
Shopify Partner
4112 804 1155

use this
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;margin: 0 auto;" data-mce-fragment="1" data-mce-style="border-collapse: collapse; margin: 0 auto;">

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder

niraj_patel
Shopify Partner
2391 516 516

This is an accepted solution.

Hello @miltokas 

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
<style>
 table:not([class]) {
   margin: 0 auto !important;
 }
</style>

techlyser_web_0-1710087404692.png

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com
worncurations
Visitor
3 0 0

Hello, I have tried following your above steps mentioned to center the entire table displayed on my shipping page but it doesnt seem to be working. I have managed to center everything else besides the table so far. Would you be able to help me? https://worncurations.com.au/pages/shipping

 

Thanks 🙂

PageFly-Henry
Shopify Partner
1184 335 299

Hi @miltokas 

This is Henry from PageFly - Landing Page Builder App

 

You can try this code by following these steps: 

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file base.css

Step 3: Paste the below code at bottom of the file -> Save


.page-width--narrow {

    max-width: 46.6rem !important;

}

 

Hope that my solution works for you.

Best regards,

Henry | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.