Title: insert image
Last modified: December 6, 2017

---

# insert image

 *  [lechur](https://wordpress.org/support/users/lechur/)
 * (@lechur)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/insert-image-8/)
 * Hi Gurus,
 * I have a problem with inserting image into my pdf generator with desired size.
   
   As a first I get image by:
 * `$image = wp_get_attachment_image($first, 'full' );`
 * when I echo to an empty table with 1 row and 1 column:
    `echo $image;` image 
   is inserted correctly and fits the whole page.
 * When I create 3 columns and I span them image takes original size.
 * How the syntax to insert image to fit full td width should looks like?
    I have
   tried:
 * `echo <td colspan="3" style="width:2435px;float:center;">;` without luck.
 * My table definition and columns above use width:30% but it has no impact, size
   is always the same and I cannot find a method to insert image to fit full width
   of tables across 3 columns.
 * regards
    Karol
    -  This topic was modified 8 years, 6 months ago by [lechur](https://wordpress.org/support/users/lechur/).

Viewing 1 replies (of 1 total)

 *  Moderator [Marius L. J.](https://wordpress.org/support/users/clorith/)
 * (@clorith)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/insert-image-8/#post-9767628)
 * Hi,
 * So without seeing what’s happening, or knowing your code, I would presume that
   your PDF generator is taking the size of tables and applying the base width to
   the image.
 * What you could try, is passing a style attribute to the `wp_get_attachment_image()`
   function ([the 4th argument can be an array of attributes](https://developer.wordpress.org/reference/functions/wp_get_attachment_image/))
   that define a `width: 100%;` on the image it self, this should (in theory) give
   your generator the data it needs to work with.

Viewing 1 replies (of 1 total)

The topic ‘insert image’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Marius L. J.](https://wordpress.org/support/users/clorith/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/insert-image-8/#post-9767628)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
