Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come my table doesn't have lines around the rows and colums?

Tags:

html

I'm very new to HTML so please excuse me if this question is very simple.

I created a table using . When I look at my table there are no lines anyplace. Is there I can make lines appear around the cells?

like image 628
Mariko Avatar asked Oct 25 '25 15:10

Mariko


2 Answers

A basic table implementation would be:

<table border=1>
 <thead><tr><td>#</td><td>Name</td></tr></thead>
 <tbody>
  <tr><td>1</td><td>One</td></tr>
  <tr><td>2</td><td>Two</td></tr>
  <tr><td>3</td><td>Three</td></tr>
  <tr><td>4</td><td>Four</td></tr>
 </tbody>
</table>

however, through CSS styling you can do more sleek borders like:

<table cellspacing=0 style="border:1px solid #ccc;">
 <thead><tr><td>#</td><td>Name</td></tr></thead>
 <tbody>
  <tr><td>1</td><td>One</td></tr>
  <tr><td>2</td><td>Two</td></tr>
  <tr><td>3</td><td>Three</td></tr>
  <tr><td>4</td><td>Four</td></tr>
 </tbody>
</table>
like image 99
Naveed Ahmad Avatar answered Oct 27 '25 04:10

Naveed Ahmad


With the CSS border property

Opera have a web standards tutorial that includes a large section on CSS if you need it.

like image 29
Quentin Avatar answered Oct 27 '25 05:10

Quentin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!