Jump to content

Recommended Posts

Posted

Hi,

 

I'm trying to create a table where some columns are right aligned. Code exerpts -

 

Style definitions -

 

thead.tableHeading1

{

font-family: Arial, Helvetica, sans-serif;

font-weight: bold;

font-size: 10pt;

}

 

col.alignRight

{

text-align: right;

}

 

Partial table definition -

 

<table border = 1 cellspacing = 0 cellpadding = 3>

 

<colgroup>

<col width = 80>

<col width = 80 class = alignRight >

</colgroup>

 

<thead class =" tableHeading1">

 

<tr>

<td colspan = 7 align = center>Summary

<tr>

<td>Bank

<td>Usage

</thead>

 

etc...

 

This is rendered as I would expect in IE; the second column is right aligned. In Firefox, the alignment specification in the col tag seems to be ignored and everything is left aligned. I have also tried using "align = right" and an inline style in the col tag, with the same result.

 

The only way I can seem to get the correct alignment in Firefox is to specify the alignment in every <td> tag.

 

I'm rather new to CSS, so I expect there's something wrong with my understanding, but I thought that the column style would override the table heading style (as it does in IE).

Posted

I just discovered that Firefox is actually doing the right thing according to the specification. I must say that the specification doesn't make sense to me in this regard.

 

http://www.w3.org/TR/CSS21/tables.html#q4

 

I think this means that the only legal way to override the cell alignment for a particular column is to specify the alignment in every <td> tag for that column. Does anyone know better?

Posted
Welcome to the forums glodilox :huh:

 

You are referencing a working draft model. This is for the CSS 2.1 specification and not all browsers will recognize it yet.

 

Hello, hello & hello!

 

Thanks,

 

I'll point myself at the current specification. Although the column style inheritance "problem" still remains. I'm generating HTML reports (from a C++ app) and I'm trying to cut down the size of the HTML files and the increase the speed at which they load. Using CSS has greatly improved things so far! I only need support Firefox and IE 6, so any features currently supported and not likely to change are ok.

Posted
IE6 is going to be your trouble as they (M$) are not as standards compliant as they try to let everyone believe they are.

 

Yes, it seems to be their MO to frustrate the standards that they don't own.

 

I've been developing using Ff and testing occaisionally in IE - maybe I should do it the other way around!

Posted
I've been developing using Ff and testing occaisionally in IE - maybe I should do it the other way around!

If your viewing audience is using IE that would be quicker.

Posted

Welcome to the forums!

I've been developing using Ff and testing occaisionally in IE - maybe I should do it the other way around!

That's how I do it as, unfortunately, most of the world revolves around Micro$oft.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...