tags:

views:

23

answers:

2

Hi all, I just need to show my plain html table in which it shows only lines of rows and hide columns in it, so that the another person seeing it, thinks it as a table with one column, but actually it has multiple columns...I cant use colspan, as I need columns as itself...

Please help thanks..

+1  A: 

Turn the border off on your: <table border="0" class="thisTable">, and give it a class like the example. Then add the following lines to your CSS:

table.thisTable {
 border-bottom:1px #000 solid;
 // edit:
 border-spacing:none; // you need this to take away spacing you still see
 border-collapse:collapse; // you need this to take away spacing you still see
}

table.thisTable td {
 border-top:1px #000 solid;
}

This will add a border at the top for each td and end the table off with a bottom border.

Hope this helps.

//edit:

Add a class to the first and last <td> of each <tr> and define the following in your CSS as well:

table.thisTable td.first {
 border-left:1px #000 solid;
}

table.thisTable td.last {
 border-right:1px #000 solid;
}

This will round the borders off nicely along the edges of the table.

Anriëtte Combrink
Nice answer. Much more elegant than my own solution.
Saladin Akara
this is close to my required solution, but still I need more advice from u regarding this, since I am using abckground color, its still showing some column-shadow or marks on the column line. I need to removwe this.thanks
soorajthomas
Sooraj, I fixed my answer to fix the spacing between columns. See above.
Anriëtte Combrink
A: 

Use CSS to style your table:

td {
   border-bottom: 1px;
   border-top: 1px; /* optional, you will have to play with the formatting */
   border-left: none;
   border-right: none;
}

This will give a top and bottom border to each data cell, which should do what you need it to. Play a little with the formatting to make sure you get it right.

Saladin Akara