John
John

Reputation: 3945

how to show rows in table

Using style attribute I want to show the cell borders of a table;

<table 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 style="border:10px">
                    <th scope="col">@T("Code")</th>
                    <th scope="col">@T("Product")</th>
                    <th scope="col">@T("Unit Price")</th>
                    <th scope="col">@T("Quantity")</th>
                    <th scope="col">@T("Value")</th>
                </tr>
            </thead>
            <tbody>

ATM looks like: enter image description here Tried something like:

<tr style="border:10px; border-style:solid; border-color:Black;">

but no joy

Upvotes: 0

Views: 55

Answers (3)

SethMW
SethMW

Reputation: 1082

As others have mentioned you probably want to style the td, not the tr. However, your styling of the tr should show something, so my guess is that your styles are being overridden from another css file, or something. Use Fire Bug, or Dev Tools in Chrome (Right click > inspect element) and you can see the styles on your td's. You can then see which are being overridden (1), which are being applied (2), and where they are coming from (3).

enter image description here

Upvotes: 0

Arpit Jain
Arpit Jain

Reputation: 455

if you want to display border of each cell then you need to just add an style attribute with following value :

<td style="border:1px solid Black;"></td>

syntax of the border property is :

border: width|style|color;

where value of style are :

none: Defines no border dotted: Defines a dotted border dashed: Defines a dashed border solid: Defines a solid border double: Defines two borders. The width of the two borders are the same as the border-width value groove: Defines a 3D grooved border. The effect depends on the border-color value ridge: Defines a 3D ridged border. The effect depends on the border-color value inset: Defines a 3D inset border. The effect depends on the border-color value outset: Defines a 3D outset border. The effect depends on the border-color value

Upvotes: 1

Goose
Goose

Reputation: 3279

If you want the border on the cell, then add it to the cell not the row.

CSS:

td {
    border: 1px solid black;
}

or inline:

<td style="border: 1px solid black;"></td>

Upvotes: 1

Related Questions