On my frontend I am using Boostrap 4, however Gutenberg block table has class <table class="wp-block-table"> so instead of creating new table style it would make more sense to append the Boostrap table class to wp-block-table class. Would like to know if this possible. Thanks.


Since my theme did not recognize wp block table class I have added table Sass class from Gutenberg to my theme.

.wp-block-table {
  width: 100%;
  min-width: 240px;
  border-collapse: collapse;
  margin-bottom: 24px;

  td, th {
    padding: .3em;
    border: 1px solid rgba(0, 0, 0, 0.1);
    word-break: break-all;
  th {
    text-align: center;
| improve this answer | |

You can add .table as the class under the "block settings" for the table block. You can also add additional classes such as .table-bordered and .table-styled. All table class references can be found in the Bootstrap Docs.


| improve this answer | |
  • The classes on that field will get added to the <figure class="wp-block... and not on the <table> inside it. – NextGenThemes Jun 27 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.