How to fit 4 columns in 3 column HTML table? -
i don't know how word question i'm working on table , has 3 columns everywhere want fit 4 cells in 1 row width remains same. how do it? mean:
------------- | 1 | 2 | 3 | ------------- | 1|2 |3|4| -------------
is after? outer columns 33% width fits width of screen. inner columns of table set 25% width fits within 33% columns. have given each column different color border can see how looks.
.column1, .column2, .column3{width:33.3%; font-family: gotham, "helvetica neue", helvetica, arial, "sans-serif";padding:5px 0px;} .column1{border:1px solid #ff0000;} .column2{border:1px solid #fff000;} .column3{border:1px solid #000000;}
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="column1"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td width="25%" align="center" valign="middle">1</td> <td width="25%" align="center" valign="middle">2</td> <td width="25%" align="center" valign="middle">3</td> <td width="25%" align="center" valign="middle">4</td> </tr> </tbody> </table></td> <td class="column2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td width="25%" align="center" valign="middle">1</td> <td width="25%" align="center" valign="middle">2</td> <td width="25%" align="center" valign="middle">3</td> <td width="25%" align="center" valign="middle">4</td> </tr> </tbody> </table></td> <td class="column3"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td width="25%" align="center" valign="middle">1</td> <td width="25%" align="center" valign="middle">2</td> <td width="25%" align="center" valign="middle">3</td> <td width="25%" align="center" valign="middle">4</td> </tr> </tbody> </table></td> </tr> </tbody> </table>
cheers
Comments
Post a Comment