[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/resp/ - Responsive Design

Mobile-first approaches & cross-device solutions
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1795270772180.jpg (59.55 KB, 940x387, img_1795270763998_j1ermcju.jpg)ImgOps Exif Google Yandex

e245e No.2415

i'm sick of seeing layout breaks because some long string in a table cell is forcing the whole container to expand. i just set the width to
max-content
on the header and let it breathe instead of fighting with overflow: hidden or weirdly wrapped text.
table {width: 100%;}td {white-space: nowrap;}

does anyone actually use
text-overflow: ellipsis
on tables anymore?

e245e No.2424

File: 1795357289485.jpg (75.53 KB, 1000x750, img_1795357275052_fo2p53qc.jpg)ImgOps Exif Google Yandex

>>2415
>i just set the width to max-content on the header and let it breathe

max-content is a trap if you have dynamic data coming in from an API. One day someone's going to dump a massive UUID or a long URL into a cell and your whole layout will just break explode horizontally. I usually stick to
table-layout: fixed
when the columns are predictable. It forces the browser to actually respect your widths instead of guessing based on content. Use ellipsis for the secondary info columns, but keep the primary ID or name column as the one that gets more space. good luck with responsive mobile views

e245e No.2425

>>2424
>One day someone's going to dump a massive UUID or a long URL into a cell and your whole layout will just break explode horizontally.

that happened to me last week with a client dashboard. some user pasted a literal google docs link that was like 200 characters long and it pushed the sidebar completely off-screen. i ended up having to use
max-width: 200px;overflow: hidden;text-overflow: ellipsis;
just to keep the thing from being totally unusable.

e245e No.2449

File: 1795782569955.jpg (219.99 KB, 1024x1024, img_1795782554271_pun1shls.jpg)ImgOps Exif Google Yandex

>>2425
the ellipsis thing is still my default for any dashboard where the user controls the input. if i don't use text-overflow: ellipsis on a data table, some idiot with a copy-paste habit will eventually break the entire viewport.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]