Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overflow-wrap break-word vs anywhere #34

Open
kzhui125 opened this issue Jul 5, 2024 · 0 comments
Open

overflow-wrap break-word vs anywhere #34

kzhui125 opened this issue Jul 5, 2024 · 0 comments

Comments

@kzhui125
Copy link

kzhui125 commented Jul 5, 2024

image

If the value of width is something other than min-content, then break-word and anywhere will have the same results.

but in my testing, break-word and anywhere is different in table when width is auto, can you help

<!DOCTYPE html>
<html>

<head>
    <style>
        table {
            font-family: arial, sans-serif;
            border-collapse: collapse;
        }

        td,
        th {
            border: 1px solid #dddddd;
            text-align: left;
            padding: 8px;
        }

        td {
            width: auto;
            /* overflow-wrap: break-word; */
            overflow-wrap: anywhere;
        }

        tr:nth-child(even) {
            background-color: #dddddd;
        }
    </style>
</head>

<body>

    <h2>HTML Table</h2>

    <div style="width: 600px;">
        <table>
            <tr>
                <th>Column1</th>
                <th>Column2</th>
            </tr>
            <tr>
                <td>Centro comercial
                    MoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezumaMoctezuma
                </td>
                <td>Centro comercial
                    </td>
            </tr>
        </table>
    </div>


</body>

</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant