Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, this would simply require some CSS styling after changing the first column to header cells. For that, please change the used Shortcode to

    [table id=123 first_column_th=true /]

    Then, please add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-123 tbody th {
      background-color: #ff0000 !important;
    }

    123 is the table ID in this case.

    Regards,
    Tobias

    Thread Starter bradmaclean

    (@bradmaclean)

    fantastic! will give it a try and let you know how it turns out. thank you for the quick response, Tobias.
    Brad

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter bradmaclean

    (@bradmaclean)

    Worked like a charm! Thank you. I’m now working to fine-tune a few things … (1) try change the column width for column 1 and (2) add cell border lines to that same column. Do you happen to have the custom CSS off the top of your head to help me along with that?

    Thanks again for all your help.

    P.S> Rated plugin a well-deserved 5!

    Thanks again!

    Brad

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Brad,

    good to hear that this helps!

    For that, just extend the CSS to:

    .tablepress-id-123 tbody th {
      width: 200px;
      background-color: #ff0000 !important;
      border: 1px solid #333333;
    }

    For more styling suggestions, I also suggest to take a look at https://tablepress.org/faq/

    Regards,
    Tobias

    Thread Starter bradmaclean

    (@bradmaclean)

    That was easy. I feel like is should’ve figured that one out :-). Thx man. Hey , off topic, have a question – are you able to make money developing and supporting a plugin when you offer it for free like this plugin? Or are you not necessarily doing it for that? I ask because I have an engineer friend who created his own Javascript framework and he is wondering how he should approach putting it online and sharing with others. Wondering if putting it out there for free is the best model for him considering he wants to make little money but mainly wants to get his name out there, create some street cred, and contribute to the tech community in some meaningful way. I assume putting things out there for free is meant to achieve the latter? Would love your insights and advice. Thanks Tobias.
    Best,
    Brad

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Brad,

    good to hear that this worked as well! ??

    Indeed, I don’t do this for a living or for money, it’s just a (big) hobby. The model that one chooses to go “pro” are very different, it ranges from selling a product (non-open-source) or open-sourcing it and offering pro support. That’s probably what I’d go for.

    Regards,
    Tobias

    Thread Starter bradmaclean

    (@bradmaclean)

    love it; very admirable. thanks for the advice; i also like the idea of open-sourcing and provide pro support.

    Take care Tobias!

    Brad

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Brad,

    sure, always happy to help!

    Best wishes,
    Tobias

    Thread Starter bradmaclean

    (@bradmaclean)

    Hi Tobias,
    Hope this finds you well. Have a follow-up question in regards to table-header formatting. As per our thread above, you helped me make the first column of my table the table header by using this shortcode: [table id=123 first_column_th=true /]. Is it possible to include the second column as a TH as well ? I ask because I have a table where there are column spans from the first column to the second, both of which should be treated, from a formatting perspective, as table headers (th). Check out the table in this PDF (second page) ; you’ll see what i’m talking about: https://heim.wpengine.com/wp-content/uploads/2016/03/Rousselle-Single-Pt.-Gap-Cast-15-110-tons.pdf Note: trying to re-create this table on a webpage in wordpress using your plugin.

    Thanks,
    Brad

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Brad,

    no, sorry, giving the second column actual <th> HTML elements is not supported by TablePress.
    Your only real chance here would be to give that column the same styling via CSS code.

    Regards,
    Tobias

    Thread Starter bradmaclean

    (@bradmaclean)

    Ah gotcha. I’ll give that a try; thx Tobias for the quick response.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    sure, no problem! You are very welcome!

    Best wishes,
    Tobias

    @tobiasbg Do you think it would be a good idea to add the scope attribute to the th tag when using the first_column_th parameter? The output should look something like this:

    <th class="column-1" scope="row">Row Header</th>

    Does this make sense?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    I see what you mean, and you are definitely right! TablePress needs better support for such attributes, like scope and other aria things. Right now, however, the only way to achieve this is to manually add them via the plugin filter hooks ??

    Regards,
    Tobias

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Format first column as a header’ is closed to new replies.