what is the basic way to render a fixed layout table that will be consistent in every browser (ie 6-8, FF, chrome)

i am using:


my first column is width=200px and all other columns are width=30px

it seems if i specify each column width with no table width i get the best results in FF, Chrome and IE8, but ie7 seems to ignore the column widths in this case. (all columns in ie7 seems to be about the same width)

if i add an explicit table width, now FF seems to ignore the column specific widths . .

any suggestions?

  • Dumb question, I know, but do the column widths add up to the total table width? Doug over 9 years ago
  • Care to show a snippet of your codes? BTW, IE7 is a pain in the .... oh and IE6 too. We'll still have to live with them. o.k.w over 9 years ago
  • column widths do add up to total table width Adam K. over 9 years ago

1 answer

o.k.w 2355

I have no issue with the table using what you have described. This is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<style type="text/css">
<table id="myTable" border="1" cellspacing="0" cellpadding="0" style="width: 290px;">
    <td style="width:200px">1</td>
    <td style="width:30px">2</td>
    <td style="width:30px">3</td>
    <td style="width:30px">4</td>

I get consistent output in IE8 and FF and I think IE7 too. Is there something I missed out?

Answered over 9 years ago by o.k.w
  • i am using : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> does that matter ? Adam K. over 9 years ago
  • Not really, at least not for the rendering of the table. Are you able to use the my code and see if it works for you (using your XHTML doctype)? o.k.w over 9 years ago