Friday, 12 October 2012

Empty cells in a table

One day i worked on a table that fetches some record from database.But the empty cells were coming without border like that:(in internet explorer)

actually the table tag is like that

<table border="1">

To troubleshoot problem my TL suggested to include attribute/values for table tag as
rules="all" frame="box"

<table border="1" rules="all" frame="box">

my problem was solved (:)

Rules attribute of table tag--he rules attribute allows you to set borders (also called rules, surprise, surprise!) inside the table at the boundaries between cells
//Display only the borders between the rows:

<table rules="rows">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>

Table with rules="rows":
MonthSavings
January$100

//Display only the borders between the coloumns:

<table rules="cols">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>

Table with rules="cols":
MonthSavings
January$100

<table rules="all">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>
</body>
</html>

Table with rules="all":
MonthSavings
January$100

frame="box "Display only the outside borders of a table:

Note: to encounter the above problem either give

<table border="1" rules="all" frame="box">

or
<table border="1"  frame="box">


 

No comments:

Post a Comment