John
John

Reputation: 3945

show all border lines for a table

why does :

 <table style="border:1px solid black; " class="table-bordered table-striped table">
            <colgroup>
                <col id="Col1" />
                <col id="Col2" />
                <col id="Col3" />
                <col id="Col4" />
                <col id="Col5" />
            </colgroup>
            <thead>
                <tr>
                    <th style="border:1px solid black;" scope="col">@T("Code")</th>
                    <th style="border:1px solid black;" scope="col">@T("Product")</th>
                    <th style="border:1px solid black;" scope="col">@T("Unit Price")</th>
                    <th style="border:1px solid black;" scope="col">@T("Quantity")</th>
                    <th style="border:1px solid black;" scope="col">@T("Value")</th>
                </tr>
            </thead>
            <tbody>

look like: enter image description here

I want to show all the borders of all the cells?
Should the style in the <table> have done this?

Upvotes: 1

Views: 4963

Answers (3)

Patrick Hofman
Patrick Hofman

Reputation: 156978

When using css you can set the border of a table and it's cells like this

table, th, td
{
    border: 1px solid black;
}

Upvotes: 5

Karuppiah RK
Karuppiah RK

Reputation: 3964

Use border="1" in your table like this <table border="1">

Demo JsFiddle Using border="1"

Demo JsFiddle Using style="border:1px solid black;"

Upvotes: 2

Naveen
Naveen

Reputation: 1502

There is a difference between Table border and css border. To apply border to each cell you have to use Table border using table property called border or apply css border to each cell of the Table. To learn more please visit following LINK

Upvotes: 0

Related Questions