I want to create a diagram using HTML. I used a table with fixed with columns. Everything looks well, but if the content of the a cell is too long, the column width is expanded. I would like the column width to remain fixed, even if some of the content is hidden.
Is there a way to do so?
Try...
table {table-layout: fixed}
in your stylesheet.
This forces the browser to use the fixed table layout algorithm...
Fixed table layout algorithm:
- The horizontal layout only depends on the table's width and the width of the columns, not the contents of the cells
- Allows a browser to lay out the table faster than the automatic table layout
- The browser can begin to display the table once the first row has been received
(See http://www.w3schools.com/Css/pr_tab_table-layout.asp)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With