Stack Over
Stack Over

Reputation: 37

Remove 2 vertical borders from HTML table - how?

table {
    border-collapse: collapse;
}
table td, table th {
    border: 1px solid black;
    text-align: center;  
	font-size: 18px;  
	font-weight: bold;
	color: black;
}
table tr:first-child th {
    border-top: 0;
}
table tr:last-child td {
    border-bottom: 0;
}
table tr td:first-child,
table tr th:first-child {
    border-left: 0;
}
table tr td:last-child,
table tr th:last-child {
    border-right: 0;
}
td.left {
	text-align: left;
	font-color: black;
}
td.left2 {
	text-align: left;
	font-color: black;
	border: 0;
vertical-align: middle;
}
td.noborder {
	border: 0; 
}
th.noborder {
	border: 0;
vertical-align: middle;
}
tr.noborder td, th {
	border: 0;
}
th.mini {
	background-color: #3a6179;
	color: #ffffff;
    font-size: 18px;
}
td.workbooks {
	background-color: #15125f;
	color: #ffffff;
	border-left: none;
}
td.salesforce {
	background-color: #019cdc;
	color: #ffffff;
	border-right: none;
#left { 
    display: none; 
    float: left; 
    width: 212px;
}
#right { 
    display: block;
    float: right;
    width: 100%;
<table>
	<tbody>
		<tr class="noborder">
			<td>
				&nbsp;</td>
			<th class="noborder" colspan="2">
				<img src="http://www.workbooks.com/sites/default/files/image/workbooks-logo.png" style="height: 66px; width: 250px;" /></th>
			<th class="noborder" colspan="2">
				<img src="http://www.workbooks.com/sites/default/files/image/SalesForce-Logo-web.png" style="height: 89px; width: 130px;" /></th>
		</tr>
		<tr class="noborder">
			<td class="left2">
				Independant user reviews</td>
			<td colspan="2">
				<img src="http://www.workbooks.com/sites/default/files/image/workbooks-stars_0.png" /></td>
			<td colspan="2">
				<img src="http://www.workbooks.com/sites/default/files/image/Salesforce-stars.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Edition version</td>
			<td class="workbooks">
				CRM Edition</td>
			<td class="workbooks">
				Business</td>
			<td class="salesforce">
				Professional</td>
			<td class="salesforce">
				Enterprise</td>
		</tr>
		<tr>
			<td class="left">
				Typical cost per user per month</td>
			<td class="workbooks">
				£19</td>
			<td class="workbooks">
				£42</td>
			<td class="salesforce">
				£45</td>
			<td class="salesforce">
				£85</td>
		</tr>
		<tr>
			<td class="left">
				Contact Management</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Opportunities, Quotes, Forecasting, Products</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Case Management, Email2case, Web2case</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png"  /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>

		<tr>
			<td class="left">
				Marketing Campaigns</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png"/></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Reports &amp; Dashboards</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png"/></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Outlook Integration (1)</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png"  /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Google Apps Integration</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Mix and Match Licensing (2)</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png"  /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Sales Order Processing</td>
			<td class="workbooks">
				&nbsp;</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				&nbsp;</td>
			<td class="salesforce">
				&nbsp;</td>
		</tr>
		<tr>
			<td class="left">
				Supplier Purchasing</td>
			<td class="workbooks">
				&nbsp;</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				&nbsp;</td>
			<td class="salesforce">
				&nbsp;</td>
		</tr>
		<tr>
			<td class="left">
				Invoicing &amp; Credit Notes</td>
			<td class="workbooks">
				&nbsp;</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				&nbsp;</td>
			<td class="salesforce">
				&nbsp;</td>
		</tr>
		<tr>
			<td class="left">
				Automation Engine</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				&nbsp;</td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Web Services API for Integration</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				&nbsp;</td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Profile and Page Layouts</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				&nbsp;</td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				Sandboxes for Testing &amp; Development</td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="workbooks">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
			<td class="salesforce">
				&nbsp;</td>
			<td class="salesforce">
				<img src="http://www.workbooks.com/sites/default/files/image/tick-new.png" /></td>
		</tr>
		<tr>
			<td class="left">
				G2Crowd Customer Satisfaction Score (3):</td>
			<td class="workbooks" colspan="2">
				96</td>
			<td class="salesforce" colspan="2">
				89</td>
		</tr>
	</tbody>
</table>
<p><!--Comparison table ends here--></p>

I'd like to remove the 2nd and 4th vertical borders (lines) (Shown between CRM edition and Business/Professional and Enterprise) in my HTML table found at: http://www.workbooks.com/workbooks-vs-salesforce

So my table will look like the following: http://www.workbooks.com/sites/default/files/image/new-lined-table-2.png

Apologies I can't post images since my rep is too low.

Thanks,

Sam

Upvotes: 2

Views: 2723

Answers (4)

Michael Dziedzic
Michael Dziedzic

Reputation: 543

Add the following to all the <td>s in the "CRM Edition" and "Professional" columns (add a class to them to be able to target them).

border-right: none;

Apologies if I'm misunderstanding your question. If you post the relevant HTML I could mess around with it in JSFiddle.

Upvotes: 0

TreeTree
TreeTree

Reputation: 3230

I'm assuming the results in the image is all you need.

.workbooks:nth-child(2), .salesforce:nth-child(4) {
    border-right:none;
}

.workbooks:nth-child(3), .salesforce:nth-child(5) {
    border-left:none;
}

Upvotes: 1

sebnukem
sebnukem

Reputation: 8303

Just remove the vertical borders:

td.workbooks, td.salesforce {
    border-left: none;
    border-right: none;
}

The cell colors already neatly provide the visual separator of columns.

Upvotes: 1

Veverke
Veverke

Reputation: 11338

Have you tried removing the right border of every 2nd and 4th row cells? Perhaps the following jQuery snippet will do.

$.each($("#yourTableID tr:not(:first)"), function(index, element) {
   $.each($(this).find("td:nth-child(2)"), function(i, e) {
      $(this).css("border-right-style", "none");
   }};    
});

Upvotes: 0

Related Questions