0

I'm trying to format a table. In both Chrome and Firefox the style for the TR seems to be ignored when I load the file into the browser. I'm just trying to add a border to the row. The style for the table and the TD are used.

If I use the source in a fiddle it works.

for what it's worth extracting the style to a separate css file didn't help.

here's the link to the fiddle. http://jsfiddle.net/kdubs/6Ppf4/

<!DOCTYPE html> <html> <style type="text/css"> table { border: 5px solid red; } tr { border: 3px solid green; } td { border: 1px solid blue; } </style> <body> <div> <table> <tbody> <tr> <td> one </td> <td> two </td> </tr> <tr> <td> three </td> <td> four </td> </tr> <tr> <td> five </td> <td> six </td> </tr> </tbody> </table> </div> </body> </html> 

1 Answer 1

1

If you run it in the JSFiddle without normalization it doesn't work either - Not working

To fix it add border-collapse: collapse; to your table - DEMO

Sign up to request clarification or add additional context in comments.

1 Comment

that works. thanks. do you know why ? I'm trying to learn how to apply the style rules.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.