border

E

earl

Here is the code for a simple table :

<center>

<table width="80%" border="1" cellspacing="0" cellpadding="0" id="news">

<tr>

<td width="50%" id="news_header">Test</td>

<td width="50%" id="news_header">10/26/2003</td>

</tr>

<tr>

<td colspan="2" id="news_main">test</td>

</tr>

<tr>

<td colspan="2" id="news_footer>.</td>

</tr>

</table>



I'd like to have a border around the table but no border between the inner
cell's, how can I do this using css ?
 
K

Kris

I'd like to have a border around the table but no border between the inner
cell's, how can I do this using css ?[/QUOTE]

table { border: 1px solid blue; }
th, td { border: 0; } /* this line is not necessary, though */

Mind the ID values in your markup. You cannot have two ID's of the same
value. Use unique ID values, or a CLASS instead. Here a revamped table:

<table cellpadding="0" summary="Something about this table's content">
<thead>
<tr>
<th>Test</th><th>10/26/2003</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2">test</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2">.</td>
</tr>
</tfoot>
</table>

Strange though, tabular data of only one cell..

table { width: 80%; border: 1px solid #000; }
thead th { width: 50%; }
th, td { padding: 0.2em 1em; }
 
L

Leif K-Brooks

earl said:
Here is the code for a simple table :
[snip]

I'd like to have a border around the table but no border between the inner
cell's, how can I do this using css ?

Don't use a table at all, that isn't tabular data. And stop using <center>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top