How to set a cell border

I want to know how to set a border of a specific cell of a table?
I know that it's possible to use style for IE, but don't know for NS. Can anyone give me a solution that can be for both NS and IE?
hcyuAsked:
Who is Participating?
 
GnissmanConnect With a Mentor Commented:
For some strange reason NS won't display the borders you declared in a style that goes with a <td>-tag. But it does work if you put the whole content of that cell in a <p> and apply the style to that:

<td>
  <p style="border-width:medium; border-color:#FF9999; border-style:dotted">
  Hallo World!
  </p>
</td>

This works fine in both IE and NS!

Gniss
0
 
hcyuAuthor Commented:
Yes, it works, but it will expand my cell width, that makes the table to be irregular. Any amendments for that? Thanks!
0
 
GnissmanCommented:
No, I am sorry. I haven't found a way to avoid that yet. Maybe setting the margin to 0 would help?

Something like <p style="margin:0mm;">

Haven't tried that yet, though.

Gniss
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
hcyuAuthor Commented:
Yes, it works, but it will expand my cell width, that makes the table to be irregular. Any amendments for that? Thanks!
0
 
GnissmanCommented:
No, I am sorry. I haven't found a way to avoid that yet. Maybe setting the margin to 0 would help?

Something like <p style="margin:0mm;">

Haven't tried that yet, though.

Gniss
0
 
GnissmanCommented:
I was just notified that you added a comment, but instead of that *my* last comment has been duplicated.

If something was lost, please repost your comment

Gniss :o)
0
 
hcyuAuthor Commented:
I found that using <div> inside the <td> can do so!!
0
 
GnissmanCommented:
Great! So <td><div style="">.. will do the trick, eh?
Gniss
0
 
hcyuAuthor Commented:
I found that using <div> inside the <td> can do so!!
0
 
hcyuAuthor Commented:
Thanks for your insight, anyway! : )
0
All Courses

From novice to tech pro — start learning today.