We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Rich text editor, tables, and removing vertical border

Solved

Rich text editor, tables, and removing vertical border

hostilearth
Shopify Partner
39 0 6

I'm attempting to remove all borders around a table, except for the bottom border of each row. In Shopify's rich text editor I have created a table and added the following CSS:

 

<style>
table {
    border-collapse: collapse;
}
tr {
    border-top: 1px solid red;
    border-bottom: 1px solid red;
}
</style>

In the rich text editor I see this:

Screenshot 2024-03-13 122355 - Copy.png

but when viewing the page I see this:

Screenshot 2024-03-13 122419 - Copy.png

Why does the page persist to show the default table borders while the editor shows the CSS? (It isn't a propagation issue.)

 

Additionally, I have tried building the tables from scratch using this post, and the vertical border between columns persists. I'll take either method, the editor's table or a table built from scratch; I'm just seeking all borders but each row's bottom border being invisible.


Thank you

Accepted Solution (1)
ThePrimeWeb
Shopify Partner
2139 616 529

This is an accepted solution.

You mean like this?

ThePrimeWeb_0-1711752415827.png

 

I got it with this

 

table {
    box-shadow: unset !important;
}

td {
    border-bottom: 1px solid red !important;
    box-shadow: unset !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

 

You might have priority issues, if so, just try this if the above doesn't work

 

.product__description table {
    box-shadow: unset !important;
}

.product__description td {
    border-bottom: 1px solid red !important;
    box-shadow: unset !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

 

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!

View solution in original post

Replies 12 (12)

ThePrimeWeb
Shopify Partner
2139 616 529

Hey @hostilearth,

 

Have you tried adding the !important tag. Maybe there's another CSS for 'tr' that is taking priority over yours. In any case, please also share the link to your store so I can check it out if the solution below isn't working

 

<style>
table {
    border-collapse: collapse;
}
tr {
    border-top: 1px solid red !important;
    border-bottom: 1px solid red !important;
}
</style>
Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!
hostilearth
Shopify Partner
39 0 6

Thank you for that suggestion. I thought it was going to work, but unfortunately, nothing changed.

ThePrimeWeb
Shopify Partner
2139 616 529

Can you share the link to your store where this table is?

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!
hostilearth
Shopify Partner
39 0 6

I don't have a link I can share, but it's very quick to duplicate.

ThePrimeWeb
Shopify Partner
2139 616 529

Our codebases are different. Even if I duplicate it on my store, it doesn't mean I'm having the same thing as you. If the issue is on your store, we have to fix it on your store, not mine.

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!
hostilearth
Shopify Partner
39 0 6

I understand your position, but I'm attempting this in a newly deployed dev store. It's vanilla Dawn, so this behavior I'm experiencing is default Shopify behavior. But thank you for trying to help; I do appreciate it.

ThePrimeWeb
Shopify Partner
2139 616 529

You can try this instead. If it doesn't work, show me a screenshot of where you pasted the code.

 

<style>
td {
    border: 1px solid red !important;
    box-shadow: unset !important;
}

table {
    border: 1px solid red !important;
    box-shadow: unset !important;
}
</style>

 

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!
hostilearth
Shopify Partner
39 0 6

Hi. It does work, in the sense that it puts a red border around all of the table (table plus inner rows and columns). Now, I can remove "table { ... }" and get just the inner borders, but I can't figure out how to remove the vertical border.

ThePrimeWeb
Shopify Partner
2139 616 529

Ok I split it into individual sides, just remove what you don't need.

<style>
td {
    border-top: 1px solid red !important;
    border-bottom: 1px solid red !important;
    border-left: 1px solid red !important;
    border-right: 1px solid red !important;
    box-shadow: unset !important;
}

</style>
Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!
hostilearth
Shopify Partner
39 0 6

Thank you. That works, but unfortunately Shopify insists on keeping the original table borders. I have tried making them white, 0px, etc. What a weird decision. I'll have to build them from scratch, I guess.

 

Screenshot 2024-03-29 150507 - Copy.png

ThePrimeWeb
Shopify Partner
2139 616 529

This is an accepted solution.

You mean like this?

ThePrimeWeb_0-1711752415827.png

 

I got it with this

 

table {
    box-shadow: unset !important;
}

td {
    border-bottom: 1px solid red !important;
    box-shadow: unset !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

 

You might have priority issues, if so, just try this if the above doesn't work

 

.product__description table {
    box-shadow: unset !important;
}

.product__description td {
    border-bottom: 1px solid red !important;
    box-shadow: unset !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

 

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!
hostilearth
Shopify Partner
39 0 6

I'm sorry, I overlooked thanking you.

 

Thank you for your help.