Linked Questions

Popular Questions

words going out of td tags

Asked by At

Words with no space between are going out of tags. I was using word-break but does work for me. How can i do it so that words don't go out of table box. Words with no space between are going out of tags. I was using word-break but does work for me. How can i do it so that words don't go out of table box

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Sales Report</title>
    <style type="text/css">
        @page {
            size: A4;
            margin: 1cm;
        }
        .table {
            width: 100%;
            max-width: 100%;
            margin-bottom: 5px;
            background-color: #fff;
            border: 1px solid #000;
        }
        .table th,
        .table td {
            padding: 5px;
            vertical-align: top;
            border: 1px solid #000;
            text-align: center;
            word-wrap:break-word; /* this is not working */ 
        }
        .table thead th {
            vertical-align: bottom;
            border-bottom: 2px solid #000;
        }
        .table tbody + tbody {
            border-top: 2px solid #000;
        }
        .table .table {
            background-color: #fff;
        }
        .list-group {
            display: block;
            width: 100%;
            list-style: none;
            margin-top: 15px;
            margin-bottom: 15px;
        }
        .list-group p {
            width: 100%;
            height: 30px;
            line-height: 20px;
            list-style: none;
            font-size: 3.64em;
        }
    </style>
</head>
<body>

<div class="container">
    <div class="card">
        <div class="card-header">
            <h3>Sales Report - {% now "jS F Y H:i" %}</h3>
        </div>

        <div class="list-group">
            <p>Name: {{ request.user.first_name }} {{ request.user.last_name }}</p>
        </div>

        <table class="table">
            <thead>
                <tr>
                    <th>#</th>
                    <th>Company Name</th>
                    <th>Company Email</th>
                    <th>Count Of Total Users</th>
                    <th>Created Date</th>
                    <th>Current Monthly Payment</th>
                    <th>Is TABopts Customer</th>
                    <th>Status</th>
                </tr>
            </thead>
            <tbody>
                {% if companies %}
                {% for company in companies %}
                        <tr>
                            <td>{{ forloop.counter }}</td>                            <td>{{ company.company_name }}</td>
                            <td>{{ company.company_email }}afsdasdfasdfasdf</td>
                            <td>{{ company.number_of_company_users }}</td>
                            <td>{{ company.company_created |date:"M d, Y" }}</td>
                            <td>{{ company.company_monthly_payment }}</td>
                            <td>{{ company.company_tab_opts }}</td>
                            <td>{{ company.company_status }}</td>
                        </tr>
                 {% endfor %}
                 {% endif %}
            </tbody>
        </table>
    </div>
</div>

</body>
</html>

Related Questions