Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table "frame" function for cell

Status
Not open for further replies.

hamking01

Programmer
May 30, 2004
238
US
I've created a table with a bunch of different cells. I'm trying to put a frame around a couple of different cells, so that it'll look like the cells a part of a group. The frame function would only work on a table. Is there a similar one for the cell. For example below each digit is a cell, I would like to frame cells 1&2, and cells 3,4,5,&6, etc..
Can this be done?

----------------------------
|1 2 |3 4 5 6 |7 8 9 2 3 4 |
----------------------------
|7 8 9 1 2 3 4 5 6 7 |8 9 0|
----------------------------
 
actually, just remembered that i could create tables within tables, and put a border around the inner tables. But anyhow, is it still possible to do this without inner tables?
 
With CSS you can, but it could be a little tiresome. Create classes and add borders to that.
Code:
<style type="text/css">
table {
  border-collapse: collapse;
}

td {
  border-top: 1px solid black;
  border-bottom: 1px solid black;
}

.framebegin {
  border-left: 1px solid black;
}

.frameend {
  border-right: 1px solid black;
}
</style>
<table>
  <tr>
    <td class="framebegin">1</td>
    <td class="frameend">2</td>
    <td class="framebegin">3</td>
    <td>4</td>
    <td>5</td>
    <td class="frameend">6</td>
    <td class="framebegin">7</td>
    <td>8</td>
    <td>9</td>
    <td>10</td>
    <td>11</td>
    <td class="frameend">12</td>
  </tr>
</table>
I haven't tested this, but I think it should do the trick you drew in your diagram.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top