0

My html

<div class="container">
    <div class="row">
        <div>
            <table class="table table-bordered table-striped" width="600">
                <tr>
                    <td>User Count</td>
                    <td>@Model.UserCount</td>
                </tr>
            </table>
        </div>
    </div>
</div>

The width="600" is ignored. I read somewhere that this is because the table fills up the container 100%. But how to override this and set a specific width for the table?

2 Answers 2

1

Use style="width:600px" rather than the width=600. Or you can do that in the style sheet:

.table {width:600px;}
Sign up to request clarification or add additional context in comments.

Comments

0

Please try below, it is working for me:

.table
{
  width: 400px;
  border: 1px solid black;
}
<div class="container">
    <div class="row">
        <div>
            <table class="table table-bordered table-striped">
                <tr>
                    <td>User Count</td>
                    <td>@Model.UserCount</td>
                </tr>
            </table>
        </div>
    </div>
</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.