?
Solved

CSS and HTML Table Issue

Posted on 2012-03-27
5
Medium Priority
?
373 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

Independent Software Vendors: 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

Find out what you should include to make the best professional email signature for your organization.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

752 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