How do you put borders around just one cell?

How do you get just one cell in the middle of a table to have a thick border around all sides of it please ? Have Googled it, but can’t seem find out how ?

Hi there Dez,

give the td element an id …

[color=navy]<td id="foo">[/color]

…then set your required CSS…

[color=navy]
<style type="text/css">
#foo {
    border:4px solid #f00;
 }
</style>
[/color]

coothead

Many thanks coothead, it’s appreciated, how would you do a collapse border, using the same idea please ?

Hi there Dez,

use…

[color=navy]
table {
    border-collapse:collapse;
 }
[/color]

coothead

Thanks coothead, but it’s just for the one cell.

Hi there Dez,

as far as I know, which isn’t a great deal, it’s all or nothing. :smiley:

coothead

You can’t collapse the border of just one cell in a table. This wouldn’t be possible, the way HTML tables are structured. Unless you need the border to flush with the other borders in the table, it shouldn’t matter though, the border is applied to just that one cell.

Otherwise, post a picture of how you’d like it to look.

Do you mean how do you remove the border from that one cell now that it has one?


#foo {
  border-width: 0;
}