column width in Table Press
-
I’m trying to adjust the column width. Is there an easy way to do this?
The width is all off:
http://redhillsfarmalliance.com/table-test/
-
Hi,
thanks for your post, and sorry for the trouble.
Actually, I wouldn’t say that the width is off in that table. It just does what the content in the table dictates.
While it is possible to adjust column widths with CSS code (see the answer to the question “How can I set column widths?” in the TablePress FAQ at http://tablepress.org/faq/ ), this will not really help in this case. The reason are the email addresses and URLs in the last two columns. As those don’t contain spaces, they are treated by the browser as one very long word. That means, that the browser is not able to automatically word-wrap those to two lines, so that they remain in one line and thus need (comparably) more space. This again reduces the available width for the other columns.
So, your best chance to gain some space might be to make all of the email addresses and URLs links, with short link texts, like “email” or “website”. That would reduce the widths of the last two columns, so that the other columns can be wider.Regards,
TobiasI like the short link idea … can I put the a href code right in the cell?
Hi,
yes, you can add the HTML code directly into the cell. If you don’t want to type the HTML code, you can also use the “Insert Link” button below the table input fields that will generate and insert the code for you.
Regards,
TobiasSo, I got it to work, sort of …
.tablepress-id-1 .column-1 {
width: 250px;
}.tablepress-id-1 .column-2 {
width: 200px;
}I can’t seem to get the cell to go exactly as wide as I indicate. I tried exaggerating to 600px and it won’t do it.
As for the email link. I put code in the cell and that works, but the link is not aligned to the other text. Maybe it will work better if I use the link.
Hi,
no, you would just use the table ID (i.e. the number), not the entire Shortcode, like this:
.tablepress-id-1 .column-1 { width: 600px; }Regards,
TobiasThank you for your quick replies! I just edited my reply as you were responding!
Hi,
playing around with the width while you have not shortened ALL URLs and email addresses to links is useless, as for the reasons I mentioned above. There’s just no space for the first and second column to grow right now.
About the “email” link not being align: The reason for that is that you have a line break before the HTML code, right before the
<a. Just remove that, and the text will align.Regards,
TobiasWhen I first set up the table I had a bunch more info, and at that point the chart ran off the page to the right. I turned off some columns and I’m now trying to make adjustments. I was assuming that I could adjust the columns to whatever width, and if it was too big, it would run off like the table that was too big before.
By the way, thank you for this plug-in! I know it will do what I need as soon as I get it right!
Hi,
no, it will only run off to the right, if the required minimum widths of the columns force that. In your table, that’s currently not the case. The “Email” and “Website” columns require (comparably) long widths, but the browser is able to compensate that by reducing the widths of the other columns (in which it can use word-wrapping due to the shorter content).
Now, if you wanted, you could let the table overflow artificially, by adding this to the “Custom CSS”:#tablepress-1_wrapper { width: 1000px; }Regards,
TobiasP.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
The topic ‘column width in Table Press’ is closed to new replies.