Hi, i'm trying to do a table with

border:1px solid #000000

But i want border between rows and columns.
Can someone help me, please?

Here's my table if it helps or something:

<table>
                <thead rowspan=1>
                    <tr>
                        <td>Nome da Banda</td>
                        <td>Estilo</td>
                        <td>Atividade</td>
                        <td>Line Up Atual</td>
                        <td>Line Up Tour</td>
                        <td>Ex-Membros</td>
                        <td>Linguagem</td>
                    </tr>
                </thead>

                <tbody>

                </tbody>
            </table>

Recommended Answers

Style your <td> elements with a border as well.

Jump to Post

Like this?

<!DOCTYPE html>
<html>
  <head>
    <style type="text/css">
      table, tr { border: 0 }
      td.mid, td.top { border-bottom: 1px solid #000 }
      td.mid, td.bottom { border-top: 1px solid #000 }
      td.middle, td.left { border-right: 1px solid #000 }
      td.middle, td.right { border-left: 1px solid #000 }
    </style>
  </head>
  <body> …
Jump to Post

All 5 Replies

Style your <td> elements with a border as well.

That's what i did JorgeM, but it stay everything seperated then i used

boder-collapse:collapse

But nothing happened

Like this?

<!DOCTYPE html>
<html>
  <head>
    <style type="text/css">
      table, tr { border: 0 }
      td.mid, td.top { border-bottom: 1px solid #000 }
      td.mid, td.bottom { border-top: 1px solid #000 }
      td.middle, td.left { border-right: 1px solid #000 }
      td.middle, td.right { border-left: 1px solid #000 }
    </style>
  </head>
  <body>
    <table cellspacing="0">
      <tr>
        <td class="top left">1A</td>
        <td class="top middle">1B</td>
        <td class="top middle">1C</td>
        <td class="top right">1D</td>
      </tr>
      <tr>
        <td class="mid left">2A</td>
        <td class="mid middle">2B</td>
        <td class="mid middle">2C</td>
        <td class="mid right">2D</td>
      </tr>
      <tr>
        <td class="bottom left">3A</td>
        <td class="bottom middle">3B</td>
        <td class="bottom middle">3C</td>
        <td class="bottom right">3D</td>
      </tr>
    </table>
  </body>
</html>

That's it, thanks man...

Hello PF2G, this is what i was suggesting in my previous post if you wanted to place a border around the table, rows, and cells.

<!DOCTYPE html>
<html>
  <head>
    <style type="text/css">
      table, tr, td {border:1px solid gray;padding:5px;border-collapse:collapse; }
    </style>
  </head>
  <body>
    <table>
      <tr>
        <td>1A</td>
        <td>1B</td>
        <td>1C</td>
        <td>1D</td>
      </tr>
      <tr>
        <td>2A</td>
        <td>2B</td>
        <td>2C</td>
        <td>2D</td>
      </tr>
      <tr>
        <td>3A</td>
        <td>3B</td>
        <td>3C</td>
        <td>3D</td>
      </tr>
    </table>
  </body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.