Floating a table to wrap text around
-
Sorry to bug you again so soon. I have some small tables that look bad and are hard to read at full width in a wide browser window. I’m trying to shrink them and wrap the text around them left or right. I’m hoping there is an easier way.
It seems the three elements (title/name, description, and the table itself) are independent and not in a wrapper/container. The main difficulty that makes is getting everything to identical width so the text is lined up (I’m using
em
to specify widths, I understandpx
is bad for responsiveness?). Also I have to clear the table or it wraps against the header/title. Not sure why the description doesn’t need that.You can see what I’ve got so far at the indicated page, 2nd table about 2/3 down the page. Here is the css that I’m using so far. It’s not pretty:
/* Shrink and float table title */ h2.tablepress-table-name-id-27 { float: left; width: 19em; } /* Shrink table columns */ Make all columns narrower .tablepress-id-27 .column-1, .tablepress-id-27 .column-2, .tablepress-id-27 .column-3 { width: 8em; } /* Float table, allow to shrink */ .tablepress.tablepress-id-27 { float: left; clear: left; width: auto; margin: 0 1em 0 0; } /* Shrink and float description */ table.tablepress + span.tablepress-table-description-id-27 { float: left; width: 30em; /* for left float */ margin: 0 1em 1em 0; }
The page I need help with: [log in to see the link]
- The topic ‘Floating a table to wrap text around’ is closed to new replies.