Solved

CSS and HTML Table Issue

Posted on 2012-03-27
5
368 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
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37770799
try
border-style:none
0
 
LVL 40

Expert Comment

by:gurvinder372
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 300 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to handle long text strings in javascript or ajax 1 31
HTML5 frame 5 25
Why a span is lower 2 20
Mouse event to control image and transparency. 4 20
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

770 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