Katrina wrote:
Gday,

Can someone please remind me how to set the width on a simple table column without suffering classitis?

Doctype: HTML4.01 strict. Must validate.

Thanks!
Kat


Hi Kat,

  I tend to mark up my tables using something like this:

<table>
   <thead>
       <tr>
           <th id="c1" axis="column-1" scope="col">Column 1</th>
           <th id="c2" axis="column-2" scope="col">Column 2</th>
      </tr>
   </thead>
   <tbody>
      <tr>
         <td headers="c1">value 1</td>
         <td headers="c2">value 2</td>
      </tr>
   </tbody>
</table>

It is attribute heavy but you can use the following CSS:

#c1 { width: 70%; } // column header width sets whole column width
#c2 { width: 30%; }

Works quite well for me cross-browser. Plus it's probably semantic (whatever that really means...)

-Rob


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to