set table column size for dyanmic data

quick question...
how do i set a table so that when dynamic data is populated the columns all remain the same size?????

here is my code for the table
i would like all 3 columns to be of equal length no matter
what fills up each column

is there a way to set that?????

thanks in advance annie :)


 <Table border="1" width="100%" cellspacing="0" cellpadding="2">
       
     <TR>
        <TH><font size="3"> Col1</font> </TH>
        <TH><font size="3"> Col2 </font> </TH>
        <TH><font size="3"> Col3 </font> </TH>
       
     </TR>
     
      <% for( int i = 0; i < reportList.size(); i ++)
      {
        String[] privs = (String[])reportList.get(i);%>
 
      <TR>        
          <% if(privs[0].equals(""))
          {%>
            <TD align="left"> <font size="3"> &nbsp; </font> </TD>
          <%}
          else
          {%>
            <TD align="left"> <font size="3"> <%=privs[0] %> </font> </TD>
          <%}%>
         
          <% if(privs[1].equals(""))
          {%>
            <TD align="left"> <font size="2"> &nbsp; </font> </TD>
          <%}
          else
          {%>
            <TD align="left"> <font size="2"> <%=privs[1] %> </font> </TD>
          <%}%>
         
         
          <% if(privs[2].equals(""))
          {%>
            <TD align="left"> <font size="2"> &nbsp; </font> </TD>
          <%}
          else
          {%>
            <TD align="left"> <font size="2"> <%=privs[2] %> </font> </TD>
          <%}%>
       
      </TR>
      <%}%>
    </Table>
annie613Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

flow79Commented:
i would simply add a css style sheet at the top of your page (in the head of your document)

<style type="text/css">
  td { width: 33% }
</style>

this will set all td's to being 33% of your table width (since your table is only 3 columns wide, 33% is the correct value - with 4 columns, itd be 25% and so on)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dorwardCommented:
http://www.w3.org/TR/CSS21/tables.html#fixed-table-layout describes the table-layout property. This can allow you to fix the size of the cells, but you will incur scrollbars, hidden content, or content flowing into the next cell (depending on the value of the overflow property) as a consquence if there isn't room in the cell.

Since you are not using CSS in your example (and you should use CSS, this is 2005!) I'll also point at http://css.nu/pointers/index.html#Tutorials where you can find some introductions to the presentation language for the web.
annie613Author Commented:
thanks to both of you.. the css works fine and thanks for the useful links!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.