Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing top border from html table cells

Tags:

html

css

I am in the initial stages of building a site with a table that will feature on many of the pages. I have successfully styled the table as I would like with the exception of a gray border at the top of every cell. I just can't seem to get rid of it.

[The site is: http://www.randysrides.com/1970-chevrolet-camaro/][1]

The HTML for the table is as follows:

<div class="spec_table">
<table>
<tbody>
<tr>
<td><strong>Engine:</strong> Wagner LS-3 (603 hp)</td>
</tr>
<tr>
<td><strong>Transmission:</strong> Bowler Tremec 5-speed</td>
</tr>
<tr>
<td><strong>Exhaust:</strong> Flowmaster Super 44 Mufflers</td>
</tr>
<tr>
<td><strong>Ignition: </strong>Crane</td>
</tr>
<tr>
<td><strong>Radiator: </strong>Be Cool</td>
</tr>
<tr>
<td><strong>Rear End: </strong>GM 12-bolt</td>
</tr>
<tr>
<td><strong>Suspension: </strong>AVCO/JME</td>
</tr>
<tr>
<td><strong>Brakes: </strong>Willwood</td>
</tr>
<tr>
<td><strong>Wheels: </strong>Billet Specialties</td>
</tr>
<tr>
<td><strong>Paint:</strong> BASF Waterborne “Grinch Green”</td>
</tr>
<tr>
<td><strong>Interior: </strong>Mark Millbrandt</td>
</tr>
<tr>
<td><strong>Seats: </strong>Recaro</td>
</tr>
<tr>
<td><strong>Sound System: </strong>Alpine</td>
</tr>
</tbody>
</table>
</div>

I then have the following CSS:

.spec_table {width: 100%; max-width: 350px; margin-top: -31px;}
.spec_table table {margin-left: 0px;border-collapse:collapse;border: 0;}
.spec_table tr {border-left: 2px solid rgba(38,201,255,1);}
.spec_table td {margin-left: -20px; font-size: .9em; line-height: 1.1em;}

I just can't seem to get rid of the light gray border at the top of every cell.

Any help would be greatly appreciated.

Thank you, Jared

like image 867
user3753413 Avatar asked Jun 18 '14 16:06

user3753413


People also ask

How do I get rid of the top border in HTML?

Use the border-top-0 class to remove the top border from an element.

How do I make a table without Borders in HTML?

To make an invisible border, set the BORDER attribute to 0. (Although most browsers default to a table border of 0, specifically stating it ensures that the border will be invisible in all browsers.)


1 Answers

You have a style for border present in your style.css

.entry-content tr td { border-top: 1px solid #eee; padding: 6px 24px; }

You need to override this style

Add this in your CSS

.spec_table td {
margin-left: -20px;
font-size: .9em;
line-height: 1.1em;
border-top: none !important;
}
like image 166
Abhishek Batra Avatar answered Sep 24 '22 00:09

Abhishek Batra