HTML: Fixed Column Width Regardless of Content

I was doing some scripting in PHP to create tables with data drawn from a database. Drawing multiple fields using the same script caused the table layout to shift. This can be fixed using the tag within the table. I thought it was kind of interesting, so I thought sharing it using an example.

An example of a 3 column table setup would be something like this:

<table width="400" border="1">
   <?php $table_count = 0; ?>
      <?php if(count($this->items) > 0):   //if there's content
         foreach($this->items as $content):   //loop through all content
            if( $table_count == 0 ): ?>
               <tr>
      <?php endif; ?>
         <td width="33%">   //to create 3 columns
            //insert content here
         </td>
            <?php if( $table_count == 2 ): ?>   //3 columns, so table_count = 3 - 1 = 2
               </tr>
            <?php $table_count = 0; ?>   //column length reached, reset count
               <?php else: ?>
                  <?php $table_count++; ?>
            <?php endif; ?>
</table>

I was using the same script to parse multiple database fields onto 1 page. E.g. an employees page of a company. The page would display all the employees categorized in different positions within the company, so the number of people per position varies.

The script shown above would be used for all the categories to create a 3 column table.
Creating the table works fine, if we parse content of 3 or more items from the database to PHP. But a problem occurs with the layout if there are less items than the number of columns within a category.

Example with enough items:

Item 1 Item 2 Item 3

 

Example if the database field has only 2 items (using the same script)

Item 1 Item 2

 

Or look at the visual example

To fix this, simply add a table-layout CSS style and <col>

><table width="70%" style="table-layout:fixed">
                     <col width="33%">
                     <col width="33%">
                     <col width="33%">

Have fun :)


[How-to-Fix] Google Maps Short URLs (old)

10 July 2011 - Found a way to get short URLs again for GoogleMaps!! :D Click here
--

30 June 2011 - Doesn't work anymore due to the implementation of Google+?
Guess we're back be stuck with super duper long GoogleMaps urls :(
--

25 June 2011 - Who doesn't use Google Maps? I use it a lot to check out locations, get travelling directions and to find restaurants and cafes. :)

Now the most annoying thing is that the URL is so damn long when you want to share your current Google Maps search with people. It clutches the whole screen and it quickly becomes chaotic when you have several links listed underneath each other.

There's a way to get short URLs on Google Maps. Go to http://www.googlelabs.com/, select "Labs voor Google Maps" on the right and enable "Short URL".

Your link will now be something like "http://goo.gl/maps/wtIy" instead of having a super long URL :)


Away3D - Transparent Planes

I saw that my blog had some search hits for Transparent Planes in Away3D. So if anyone is still looking for it, here's the code to create a transparent plane. Hope this helps! :)

var matBlank:WireColorMaterial = new WireColorMaterial(0xFFFFFF);
matBlank.alpha = 0;
matBlank.wireAlpha = 0;

var plane:Plane = new Plane({material: matBlank, width: 200, height: 200});

Re-enable Clickable Links In MSN Messenger 2009

Ever noticed that the hyperlinks posted in your msn chatbox stopped working? Apparently they turned off active links on MSN 2009 to stop a worm from spreading. I got sick and tired of copy/pasting every single one of the links in your browser, so I went to do some super detective work and found the solution.

1. Download Freeware Hex Editor XVI32: http://www.handshake.de/user/chmaas/delphi/download/xvi32.zip
2. Close Windows Live Messenger (don't forget to check the task manager)
3. Use XVI32 to open msnmgr.exe which is probably in C:\Program Files\Windows Lives\Messenger
4. Press Ctrl + F, choose Text string
5. Type in hotlinks in the search box and press OK
6. When it finds hotlinks, click on the h and change it to a t, it should now read totlinks
7. Press Ctrl + S to save

source:
http://www.forumvancouver.com/threads/clickable-links-not-working-on-windows-live-messenger-2009.577/
http://www.generationmediagroup.com/blog/re-enable-links-in-messenger-09/