puzzle / prawn-markup

Parse simple HTML markup to include in Prawn PDFs
MIT License
65 stars 16 forks source link

Implement path for setting table width (prawn-table's width options) #32

Closed allthesignals closed 1 year ago

allthesignals commented 2 years ago

According to prawn-table, there's a width option:

The default table width depends on the content provided. It will expand up to the current bounding box width to fit the content. If you want the table to have a fixed width no matter the content you may use the :width option to manually set the width.

image

I can't find a way to do this. Maybe we should start with getting it to honor the table options:

pdf.markup_options = {
  table: { width: 320 }
}

Maybe in the future, it could work this way:

<table style="width: 320px;">
</table>

Thoughts?

codez commented 2 years ago

Tables, like all other components, are always set to full width. As we do interpret the width style for table cells, I think it would be possible for tables, too.

However, I am a bit reluctant to add this because basically, CSS is out of scope for this gem. Do you have a good use case that supports this feature?

codez commented 1 year ago

Closed because of inactivity