Table styling with CSS

Table styling with CSS:

<style type=”text/css”>
table.new {
width: 500px;
border-width: 1px;
border-style: outset;
border-color: #cccccc;
background-color: #FBFFF3;
}

table.new td {
border-width: 1px;
background-color: white;
padding: 5px;
border: 1px dotted #1D2E8E;
}
</style>

The sample CSS codes redefines the <table> and <td> tags in a table with the id=”new”.
This is an effective way to set common attributes that apply throughout the table.
The result will look like this:

This is the table code as HTML:

<table align=”center” cellspacing=”5″ class=”new”>
<tbody>
<tr>
<td valign=”top”>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.</td>

<td valign=”top”>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </td>
</tr>
</tbody>
</table>

Please share it
Email this to someoneShare on Google+Pin on PinterestTweet about this on TwitterShare on LinkedInShare on Facebook