Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CSS and HTML Table Issue

Posted on 2012-03-27
5
Medium Priority
?
374 Views
Last Modified: 2012-03-27
Hi,

Having an issue with HTML and CSS.

I have created tables in several pages so that text.images can be displayed easier. Problem is I can hide the table border but not the column borders. I want all of the table borders to be invisible. See attachment.

My CSS code is:
table, td, th ,tr
{ border-style:hidden; empty-cells:hide; width:75%;

}

Open in new window


and my HTML code is:

 <table style="border:0px;" cellpadding="0"><tr style="border:0px;" cellpadding="0"><td style="border:0px;" cellpadding="0"> <p> With two Team Managers Karly Sherlock and Ben Simpson</p></td>
  <td style="border:inherit"><img src="images/demo/KarlySherlock.jpg" width="150" height="100" alt="Karly Sherlock" /></td><td style="border:inherit"><img src="images/demo/BenSimpson.jpg" width="150" height="100" alt="Ben Simpson" /></td></tr></table>

Open in new window


One last thing. This error only seems to be happening on IE, within Firefor and Safari its fine.

Cheers.
0
Comment
Question by:Simon2301
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 37770799
try
border-style:none
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 37770814
add this to your table style as well

border-collapse: collapse;
border:none;
0
 
LVL 12

Accepted Solution

by:
Tony van Schaik earned 900 total points
ID: 37773665
This should do the trick:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
table.noborders {
	border-collapse:collapse;
	margin:0px;
	padding:0px;
}
.noborders th, .noborders tr, .noborders td {
	border:none;
	vertical-align:top;
}
</style>
</head>

<body>
<table class="noborders" width="400" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img name="" src="" width="180" height="180" alt="" /></td>
    <td><img name="" src="" width="180" height="180" alt="" /></td>
  </tr>
</table>

</body>
</html>

Open in new window

0
 

Author Comment

by:Simon2301
ID: 37774014
@ TheRealTeune - A border still appears around the content.
0
 

Author Comment

by:Simon2301
ID: 37774091
OK ive just added
style="border:0px;"

Open in new window

so...
<table class="noborders" style="border:0px;" width="400" border="0" cellspacing="0" cellpadding="0">

Open in new window

and this works now. I will do further testing next few days for other browsers but it certainly fixes it for IE.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question