HTML "col" tag actions using Javascript

Wednesday, October 1, 2008

a Client was struggling to get an "onClick" function to work on one of his pages so he sent me this code:

<table border="1">
  <colgroup span="4">
   <col onclick="alert('Colomn clicked') " width="20"></col>
   <col width="50"></col>
   <col width="80"></col>
   <col width="10"></col>
  </colgroup>
  <tr>
   <td>1111</td>
   <td>2222</td>
   <td>3333</td>
   <td>4444</td>
  </tr>
  <tr onclick="alert('Row 2 clicked') ">
   <td>1222</td>
   <td>2333</td>
   <td>3444</td>
   <td onclick="alert('field 4555 clicked') ">4555</td>
  </tr>
</table>

If you run the code you will see that the "onClick" alert fires everywhere except when used in the <col> tag.
The desired effect can however be achieved using some Javascript.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
 
 <script type="text/javascript">
  function wireUpCells()
  {
    var myTable = document.getElementById("myTable");
    for(var i = 0; i < myTable.rows.length; i++)
    {
      for(var j = 0; j < myTable.rows[i].cells.length; j++)
      {
        myTable.rows[i].cells[j].setAttribute('onclick', 'alert("Welcome to (row,col) (' + (i + 1) + ',' + (j + 1) + ')")');
      }
    }
   }
window.onload = wireUpCells;
 </script>
</head>
 
<body>
<table cellspacing="0" id="myTable" border="1" style="border:1px solid #666666; border-collapse: collapse; ">
    <COL width="80" style="background-color:#EDF8F4;">
    <COL width="150" style="background-color:#EAF2FF;">
    <COL width="200" style="background-color:#FDF4E1;">
  <tr>
  <td>Row1 cell1</td>
  <td>Row1 cell2</td>
  <td>Row1 cell3</td>
  </tr>
  <tr>
  <td>Row2 cell1</td>
  <td>Row2 cell2</td>
  <td>Row2 cell3</td>
  </tr>
  <tr>
  <td>Row3 cell1</td>
  <td>Row3 cell2</td>
  <td>Row3 cell3</td>
  </tr>
</table>

</body>
</html>

Zakumi - The 2010 FIFA Mascot

Thursday, September 25, 2008

The Mascot for the 2010 world cup has recently been unveiled. I was eager to see what he/she/it looks like and was impressed when I laid my eyes on the little green leopard.

The name Zakumi is a combination of 'ZA' for South Africa, and 'kumi' meaning 10 in some African languages. The character is cute, lively and definitely better than most of the previous FIFA mascots.

Being a designer I can’t help but put in my 10cents worth about the design itself. When I think of the Leopard, I think lean, mean and fast. The people in Africa (especially the soccer players) are also mostly tall, lean people. Zakumi looks a little bit like a midget with short stumpy legs that can’t really pull off breathtaking feats of football acrobatics.
I would have liked the mascot more if Zakumi had these athletic traits of the Leopard and the people.


Wallpapers:

Zakumi wallpaper download 800X600

1024X768

1280X1024



Zakumi Wallpaper Download800X600

1024X768

1280X1024

Springleap.com - Design your own t-shirts!

Friday, September 19, 2008

I have always wanted to design my own tshirts and have on occasion printed a design of my own on a shirt, only to see that it came out really crappy and ended up being a dustrag.

Since I joined Springleap, I have gone from a person that really likes cool t-shirts, to a t-shirt addict. I walk around eyeing out peoples tees with a very critical eye, haha. I have been caught staring more than once.

Everyone want to design a kickass t-shit. Some have the natural ability to put pen or stylus down and give birth to some amazing designs. Others have the imagination, but struggle to put down what they see inside their craniums.

For those, there are vector packs and resources you can use to bring your ideas to life. Don't worry about some people that burn you for using stock material. In my opinion, a good designer uses all the resources available to him to design and create.

Check out this great tutorial: Designing Ultra sceneXcore apparel
http://www.gomediazine.com/tutorials/designing-ultra-scenexcore-apparel/

Something I am doing now is researching colours. You can have a great design, but then mess it up using the wrong colours. Software like Adobe Illustrator have colour palettes that help a lot, but you still need a fundamental knowledge of what looks good together, and what does not.

I am totally hooked, and I don't think I am the only one :)

check out the site at: www.springleap.com

Go forth and Design!

Photoshop Beginnings

Friday, August 1, 2008

Opening up Photoshop for the first time can quickly put off any budding graphic artist.
So... many ... buttons!

Photoshop has some good walkthroughs, but the only way you will learn to effectively use Photoshop is to start  doing some eye candy tutorials. This introduces you to some cool tools, good design methods and leaves you less intimidated by the software.

Heres one I did:

Photoshop Design Tutorial

Its a simple but effective effect. Learn to do these with your eyes closed and you'll soon be talking Klingon to the untrained ear!
Bevels this, Channels that, Gaussian blur, BRU!  O_O

Find this tutorial and other on this great site:
www.phong.com

Disable User Account Control (UAC) for certain Windows Vista applications

Friday, August 1, 2008

Vista users, do you get tired of naggy UAC (User Account Control) popups asking for permission when you try run your software?

*Que infomercial music*

Do you have to compromise your system security by  disabling UAC completely?

Well no more!

Here is a great article on how to run all your old software on Vista without disabling UAC.

Read more at Vista4beginners

http://www.vista4beginners.com/Disable-UAC-for-certain-applications

Center DIV's using CSS

Friday, August 1, 2008

Tables are dying a horrible death when it comes to web site design.
CSS
DIV based designs are already the preferred method of design for most web professionals.

I have had a couple of people asking me how to center DIV's using CSS.

Here is the CSS code to achieve this:

<style>
 #div1{
       width:200px;
       text-align:center;
       border:thin;
       background-color:#00CC00;
     }
 #div2{
       position:relative;
       margin:auto;
       width:100px;
       text-align:center;
       border:thin;
       background-color:#CC0000;
     }
</style>

Blog Live!

Thursday, July 24, 2008

I finally got some time to work on the blog. Feels good to have it up instead of the usual "Blog Coming Soon" Page. Coming soon in the on line environment can mean  tomorrow, next week, next year or "this is never going to happen".

Now we just need to finish the Freelancer Program. I cant give away too many details, but it's going to rock, especially if you are a programmer or designer that wants to make some extra cash on the side. Unil then, the "Coming soon" page will need to suffice.