Table Centering Inheritance

November 10th, 2008  |  Published in Web Development

I recently came across a little cross-browser issue with using the align attribute in tables. The problem was that we had some cells centering in Internet Explorer and Opera but not in Safari and Firefox. The result was how the inheritence of the align attribute is handled by the different browsers.

The first image below is in Opera, and the second is in Firefox. I wanted it to look like it does in Firefox.







The HTML for the above is:

1
2
3
4
5
6
7
8
9
10
11
12
<table width="550px" border="1">
	<tr>
		<td align="center">
			<table border="1" width="80%">
				<tr>
					<td>Apple Sauce</td>
					<td>Pecan Pumpkin Butter</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

The problem is that the

<td align="center">

is inherited by the tables within that table for IE and Opera but not for Firefox. It’s an easy fix, just make the next <td> into <td align=”left”> to fix it. It’s nothing major, probably very well known…but the first time I’ve come across it.

Previously


Jun 12, 2008
Private RSS Feeds & Feed Readers

by clong | Read | 5 Comments

We’re planning an event here at Well.ca, a secret event. But that’s not what this post is about. To organize and send out invites for this event I suggested we use MyPunchBowl. I haven’t done much with it, but it looked half decent and I’ve heard good things about it.
There was one problem with MyPunchBowl, [...]

Continue Reading →


Jun 2, 2008
Django Caching Middleware & Login Page

by clong | Read | 2 Comments

Recently on StartupIndex.ca, I’ve noticed a problem where the first time you login it fails, the second time it works. I sat down last night, and spent some time attempting to solve this problem. My search on the greater web didn’t end up with very many results, I did find one mailing list thread on [...]

Continue Reading →


May 30, 2008
StartupIndex.ca Article in ComputerWorld Canada

by clong | Read | No Comments

Jevon and I were interviewed by ComputerWorld Canada yesterday. The article just went up this morning. Can get to it here: http://www.itworldcanada.com/a/Daily-News/25b53438-4513-4bda-8527-0350f9672ae7.html

Continue Reading →


May 29, 2008
JSR 311 – Java REST Libraries

by clong | Read | 3 Comments

I’m starting to work on a project at Well.ca using Java and REST. Knowing the amount of REST libraries out there for other languages, I figured there would be a good amount for Java. Wrong!
There is a Java specification currently in draft for REST, it’s called JSR 311. Now the problem with this is that [...]

Continue Reading →


May 29, 2008
StartupIndex.ca Updated with Widgety Goodness

by clong | Read | No Comments

I updated StartupIndex.ca yesterday with some new features.

Ali updated the map on the frontpage to be more intelligent and fixed some annoying problems with it. Now it looks better and responds better.
We now have widgets! See below for an example widget, but this code can be placed into any webpage to give information on a [...]

Continue Reading →


May 29, 2008
Two New Tools for Web Dev

by clong | Read | No Comments

IETester was just released, this tool looks to be incredibly handy. Right now it’s in Alpha, but I’m still planning on using it. Previously I used Multiple IE, but I found that to be a little buggy and prone to not work at all at times. I’m planning on giving it a try sometime today, [...]

Continue Reading →

Subscribe via RSS

If you like the content of this website and are looking for a way to be notified of new content, look no further. Just click the orange icon to your right and subscribe using your favorite feed reader.