Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does <table border="1"> not work?

I have defined my table like this:

<div id="a">
    <table id="main_table" border="1">
        <tr>
            <th>Jobs</th>
            <th>Customers</th>
        </tr>
    </table>
</div>

From the example here i assume to see borders around the table and all the cells in the table. This hasn't worked me on multiple occasions lately. Does anyone know why? I am viewing in Google Chrome.

** EDIT **

Thanks everyone, I failed to mention originally that this is a table I embedded in a Joomla site, as mentioned below, the border="1" does work in general. But since it hasn't been working I always use CSS. It just kept bugging me that the simple border="1" was not working. The individual borders must be getting turned off in the CSS for the Joomla theme. .

like image 789
jeffery_the_wind Avatar asked Feb 29 '12 21:02

jeffery_the_wind


1 Answers

That's an old way of placing a border around the table. The better way to place a border around a table and cells is by using CSS:

​table, td {
    border-collapse: separate;
    border: 1px solid #999;
}​

jsFiddle example

like image 182
j08691 Avatar answered Oct 18 '22 10:10

j08691