Search code examples
htmlhtml-tablemarkup

Make html table automatically display td on the next line


I am using html tables in my admin panel. Currently, when the row is large, my table spans out of the container in a small browser window:

large-row

I would like the table row not to span out of the container when it gets so small that is unable to fit s in one row. The desired behavior is that s that don't fit apper on the next line.

Can this be achieved and how?


Solution

  • The behaviour you describe doesn't make sense for tables. Tables display rows of cells, it doesn't do advanced layouts.

    If you don't want the table to ruin the design in a narrow browser window, set the min-width property of the body tag to something wider than the table. That way, at least the scroll bar will appear at the bottom of the window, and the design won't be ruined.