borders table

I want to place a border around each table cell like in this website  with 10 images  in 2 rows.

http://www.cabinethardwarecloseout.com/Default.aspx

in html/css how do i do this?

 <table class="tbHomePage1"  border ="1"  cellpadding ="1" cellspacing ="1" >
      <tr>
      <td>    <asp:HyperLink ID="HyperLink2" runat="server"  NavigateUrl="category/29-books.aspx">
              <asp:Image ID="Image1"  ImageUrl="images/c1.png" runat="server" />
              <br />&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Books sssss sssss   </asp:HyperLink>
      </td>
   
jagguyAsked:
Who is Participating?
 
SnarflesCommented:
using your existing code... this is how to do it.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Untitled</title>
<style type="text/css">
.tbHomePage1  tr td{
	border:1px solid;
}
</style>
</head>
<body >
 <table class="tbHomePage1"  border ="0"  cellpadding ="0" cellspacing ="1" >
      <tr>
      <td>Some text</td>
      <td>Some text</td>
      <td>Some text</td>
      <td>Some text</td>
      <td>Some text</td>
      </tr>
      <tr>
      <td>Some text</td>
      <td>Some text</td>
      <td>Some text</td>
      <td>Some text</td>
      <td>Some text</td>
      </tr>
</body>
</html>

Open in new window

0
 
expertexchangersCommented:
They are using <ul> and you want to use table. Just
.tbHomePage1 {
 border:1px solid black;

}
.tbHomePage1 tr td {
 border:2px solid #CCCCCC;

}

and please don't use <br/> tag

The main reason for not using <br> is that it's not semantic. If you want two items in different visual blocks, you probably want them in different logical blocks.

In most cases this means just using different elements, for example <p>Stuff</p><p>Other stuff</p>, and then using CSS to space the blocks out properly.

There are cases where <br> is semantically valid, i.e. cases where the line break is part of the data you're sending. This is really only limited to 2 use cases - poetry and mailing addresses.
0
 
Dave BaldwinFixer of ProblemsCommented:
I would probably use tables like @Snarfles but this is the CSS for that item on that page:

div#categorymenu>ul>li{
width:85px;
border:2px solid #CCC;
text-align:center;
margin:0 0 1px 1px;
padding:2px 0;
float:left;
position:relative;
}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.