Wednesday, February 9, 2011

Table with rounded borders (XP Style)

One of my client requirements was to display data on the dash board with a bunch of XP styled tables. I am posting the code so that developers with similar requirements can re-use what I have done.

<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="5" background="images/top-left.jpg" width="5" height="29"></td>
    <td height="29" background="images/top-mid.jpg"><div style="color:#FFFFFF">My Title</div></td>
    <td width="5" background="images/top-right.jpg" height="29"></td>
  </tr>
  <tr>
    <td width="5" background="images/left-mid.jpg"></td>
    <td bgcolor="#F7F8FB">
      <div>Content Heading</div>
      <div>Content - 1</div>
      <div>Content - 2</div>
    </td>
    <td width="5" background="images/right-mid.jpg"></td>
  </tr>
  <tr>
    <td width="5" height="5" background="images/bottom-left.jpg"></td>
    <td height="5" background="images/bottom-mid.jpg"></td>
    <td width="5" height="5" background="images/bottom-right.jpg"></td>
  </tr>
</table>

The images used in this example are provided below,



Save the images in a directory named - "images" or modify the image path in HTML code. The final table would look like,

My Title

Content Heading
Content - 1
Content - 2