Free HTML and CSS for a Table Within a Post or Page



28 Dec 09

I used a 3-column, 7-row table in a recent post Why I Think Text Link Ads IS Better Than Google AdSense. If you would like to grab the HTML and CSS for it and adapt it to your own purposes – come and get it.

The Table

Here is a screenshot of the table I designed. It is made my inserting HTML into the post editor and inserting CSS into the Custom.css file.

table for post or page using HTML and CSSThe code for making this table is at the end of this post.

The Book That Makes It All Possible

I have a great book called, funnily enough, HTML XHTML & CSS, Sixth Edition – Visual Quickstart Guide by Elizabeth Castro.

It is absolutely fantastic for newbies to code and also those novice apprentices out there that can’t always remember the code.

html xhtml css book

  • It is very well indexed with lots of examples and pictures.
  • You can work your way through it and follow their examples to have a ‘play’ or you can refer to it when you need to, e.g. remembering the order of padding TRBL (top, right, bottom, left).
  • It has a great fold-out color code guide as well with swatches of colors and the hexadecimal values, e.g. White #FFFFFF.

color codesTable HTML

To insert a table like the one above, insert the following HTML code into your post editor amongst your article text.

<table cellspacing="0" cellpadding="0" width="100%" border="1" frame="border" rules="rows">
<tbody>
<tr>
<td><strong>Sidebar titles</strong></td>
<td><strong>First column title</strong></td>
<td><strong>Second column title</strong></td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
<tr>
<td><strong>Left sidebar title</strong></td>
<td>First col text</td>
<td>Second col text</td>
</tr>
</tbody></table>

Table CSS

To style your table you will need to include the following CSS code into your custom.css (custom style sheet).

  • Change the colors, font, borders, widths, etc.
  • If you want more or less columns or rows, just delete or copy and paste the <td>ROW</td> or <tr>COLUMN</tr> – taking note the format and order of row and column breaks.
.tableleft {vertical-align: top; width:120px; margin:0; padding:4px 4px 6px 4px; border:1px #898989; background: #ececec; font-style: bold; font-family: Arial; font-size: 12px;}
.tablecenter {vertical-align: top; width:200px; margin:0; padding:4px 4px 6px 4px; border:1px #898989; background: #ffffff; font-family: Arial; font-size: 12px;}
.tableright {vertical-align: top; width:200px; margin:0; padding:4px 4px 6px 4px; border:1px #898989; background: #ececec; font-family: Arial; font-size: 12px;}

Another Example of a Table

I adapted the above code to create a different table for the post 100 Reasons Why Blogussion is an Amazingly Successful Site (Part 1). Screenshot below…

table extract from blogussion article

Show Us Your Table

If you do use this code as is, or adapt it to make your own table, come back and leave a link to your post.

Related Posts

  1. 4 Nifty Code Snippets to Trick Out Your Thesis Theme
  2. P&O Cruise Ship Blogs Powered by Thesis Theme
  3. Thesis Theme HQ Updates by Email, RSS and Newsletter and a FREE eBook
  4. Jazz Up Your Archives Page
  5. 20 Awesome Thesis Theme Tutorials from 18 Different Thesis Sites

{ 9 comments… read them below or add one }

baloot December 29, 2009 at 2:10 pm

nice css table… i want to make it more rounded border by using css3… :)
baloot´s last blog ..Download Wallpaper Ubuntu Percuma My ComLuv Profile

Reply

Somone Bull December 29, 2009 at 3:50 pm

There’s a lot of chatter out there about whether to use tables or not. I would suggest using them sparingly and when they really do assist with your layout. As for round corners, there are some css tips I found but not sure what I’m doing to advise. Apparently, Firefox and Safari are good to go with rounded corners using css but IE and some other browsers still won’t play nice.

I’ll wait for some other savvy commenters to advise, like George…?

Reply

baloot December 29, 2009 at 5:16 pm

i’ve got new smashingmagazine book. it’s was awesome too.. that book tells me about designing (but in not very details). havn’t finish reading yet. :)

thesisthemehq was my source about thesis theme.. from this blog i found related articles to make here and there tweaks for thesis.
baloot´s last blog ..Download Wallpaper Ubuntu Percuma My ComLuv Profile

Reply

sürücü kursu December 29, 2009 at 8:08 pm

thanks for share.

Reply

TechChunks January 12, 2010 at 12:42 am

Nice looking CSS table. I’m sure I’m going to use one similar to this in one of my upcoming posts. Thanks :)
TechChunks´s last blog ..An Affordable $199 Tablet. And It’s Not From Apple My ComLuv Profile

Reply

Andy Walpole January 13, 2010 at 5:30 am

The Visual Quickstart books are brilliant. I took the bulk of my knowledge about PHP from two of their books. Also as well the Lynda DVD tutorials are great for learning aspects of design and development.
Andy Walpole´s last blog ..The internet 10 years ago this month – January 2000 My ComLuv Profile

Reply

peterkizumaki June 10, 2010 at 4:36 pm

I used it for my site. That’s cool. Thanks so much for your sharing !
peterkizumaki´s last blog ..The Customer Loyalty Solution (Paperback) My ComLuv Profile

Reply

lucas July 4, 2010 at 12:42 am

Can i use it within blogger posts ????

Reply

Somone Bull July 4, 2010 at 9:40 am

Yes. It’s just HTML. However, the css will have to be added to your Blogger style sheet. I’m not sure if you have access to that. I am a dedicated WordPress fan.

Reply

Leave a Comment

Previous post:

Next post: