HTML Table width in percentage, table rows separated equally -


when create table in html, table width of 100%, if want cells (tds) divided in equal parts, have enter width % each cell? "obliged" it?

e.g.:

<table cellpadding="0" cellspacing="0" width="100%" border="0">    <tr>       <td width="25%"></td>       <td width="25%"></td>       <td width="25%"></td>       <td width="25%"></td>    </tr> </table> 

or following right procedure, not write width in each tds if want each of them devided equally:

<table cellpadding="0" cellspacing="0" width="100%" border="0">    <tr>       <td></td>       <td></td>       <td></td>       <td></td>    </tr> </table> 

i know works both manners want know "legit" way it.

you need enter width % each cell. wait, there's better way that, it's called css:

<style>      .equaldivide tr td { width:25%; } </style>  <table class="equaldivide" cellpadding="0" cellspacing="0" width="100%" border="0">    <tr>       <td></td>       <td></td>       <td></td>       <td></td>    </tr> </table> 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -