2

My table class is .bottom and I want the bottom of the table to be a solid black line, all the way across. So I tried this:

<table style="border-bottom-color:#000000"> 

But that doesnt do it. So I tried this in CSS:

.bottom td {border-bottom: 2px solid black !important;} 

and now everything in the table has a black underline( links, td, image) and all I want is the table itself to has a solid black bottom border. Any suggestions are very much appreciated.

1
  • 3
    What about <table style="border-bottom: 2px solid #000000">? Keeping in mind that it's always better to have that defined in a separate stylesheet. Commented May 30, 2012 at 1:08

3 Answers 3

4

For anyone else having a similar issue with borders on tables not appearing, you also might want to make sure you have set table {border-collapse: separate;} otherwise the border won't display, even if it has been styled.

While this behaviour is default, if you are using a template (say, for an eDM), it may have been set to table {border-collapse: collapse;} somewhere in the predefined template styles.

Sign up to request clarification or add additional context in comments.

Comments

1
.bottom {border-bottom: 2px solid black;} 

4 Comments

I swear I tried this before and it didn't work, but sure enough it did this time. I must have had a type. Thanks for your help
Note, if you tried .bottom table { .. }, as was my first inclination, it won't work, because .bottom is the class FOR THE TABLE itself, not a container containing a table.
Thats exactly what I did, hehe
@JeremyGoodell: Yes - to get only a <td> with the class .bottom, one would have to use td.bottom
0

I had this same problem and all I had to do was add some margin-bottom to the table attribute.

 table { table-layout: inherit; width:91.8%; font-family: $fontserrat; margin-bottom: 10px; } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.